use objc2::{
extern_class, extern_conformance, extern_methods,
rc::{Allocated, Retained},
runtime::{NSObject, ProtocolObject},
};
use objc2_foundation::{CopyingHelper, NSCopying, NSObjectProtocol};
use crate::{MTLAccelerationStructureGeometryDescriptor, MTLBuffer};
extern_class!(
#[unsafe(super(MTLAccelerationStructureGeometryDescriptor, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLAccelerationStructureBoundingBoxGeometryDescriptor;
);
extern_conformance!(
unsafe impl NSCopying for MTLAccelerationStructureBoundingBoxGeometryDescriptor {}
);
unsafe impl CopyingHelper for MTLAccelerationStructureBoundingBoxGeometryDescriptor {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MTLAccelerationStructureBoundingBoxGeometryDescriptor {}
);
impl MTLAccelerationStructureBoundingBoxGeometryDescriptor {
extern_methods!(
#[unsafe(method(boundingBoxBuffer))]
#[unsafe(method_family = none)]
pub fn bounding_box_buffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
#[unsafe(method(setBoundingBoxBuffer:))]
#[unsafe(method_family = none)]
pub fn set_bounding_box_buffer(
&self,
bounding_box_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
);
#[unsafe(method(boundingBoxBufferOffset))]
#[unsafe(method_family = none)]
pub fn bounding_box_buffer_offset(&self) -> usize;
#[unsafe(method(setBoundingBoxBufferOffset:))]
#[unsafe(method_family = none)]
pub fn set_bounding_box_buffer_offset(
&self,
bounding_box_buffer_offset: usize,
);
#[unsafe(method(boundingBoxStride))]
#[unsafe(method_family = none)]
pub fn bounding_box_stride(&self) -> usize;
#[unsafe(method(setBoundingBoxStride:))]
#[unsafe(method_family = none)]
pub fn set_bounding_box_stride(
&self,
bounding_box_stride: usize,
);
#[unsafe(method(boundingBoxCount))]
#[unsafe(method_family = none)]
pub fn bounding_box_count(&self) -> usize;
#[unsafe(method(setBoundingBoxCount:))]
#[unsafe(method_family = none)]
pub fn set_bounding_box_count(
&self,
bounding_box_count: usize,
);
#[unsafe(method(descriptor))]
#[unsafe(method_family = none)]
pub fn descriptor() -> Retained<Self>;
);
}
impl MTLAccelerationStructureBoundingBoxGeometryDescriptor {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}