use objc2::{
extern_class, extern_conformance, extern_methods,
rc::{Allocated, Retained},
runtime::NSObject,
};
use objc2_foundation::{CopyingHelper, NSCopying, NSObjectProtocol};
use super::vertex_step_function::MTLVertexStepFunction;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLVertexBufferLayoutDescriptor;
);
extern_conformance!(
unsafe impl NSCopying for MTLVertexBufferLayoutDescriptor {}
);
unsafe impl CopyingHelper for MTLVertexBufferLayoutDescriptor {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MTLVertexBufferLayoutDescriptor {}
);
impl MTLVertexBufferLayoutDescriptor {
extern_methods!(
#[unsafe(method(stride))]
#[unsafe(method_family = none)]
pub fn stride(&self) -> usize;
#[unsafe(method(setStride:))]
#[unsafe(method_family = none)]
pub fn set_stride(
&self,
stride: usize,
);
#[unsafe(method(stepFunction))]
#[unsafe(method_family = none)]
pub fn step_function(&self) -> MTLVertexStepFunction;
#[unsafe(method(setStepFunction:))]
#[unsafe(method_family = none)]
pub fn set_step_function(
&self,
step_function: MTLVertexStepFunction,
);
#[unsafe(method(stepRate))]
#[unsafe(method_family = none)]
pub fn step_rate(&self) -> usize;
#[unsafe(method(setStepRate:))]
#[unsafe(method_family = none)]
pub fn set_step_rate(
&self,
step_rate: usize,
);
);
}
impl MTLVertexBufferLayoutDescriptor {
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>;
);
}