cobin/metal/
mtl_depth_stencil_descriptor.rs

1use crate::{
2  obj::Object,
3  PrivateMarker,
4  runtime::NSObjectBase,
5  metal::*
6};
7
8pub struct MTLDepthStencilDescriptor(PrivateMarker);
9
10impl Object for MTLDepthStencilDescriptor {}
11unsafe impl objc::Message for MTLDepthStencilDescriptor {}
12
13impl NSObjectBase for MTLDepthStencilDescriptor {
14  fn class_name() -> &'static str { "MTLDepthStencilDescriptor" }
15}
16
17impl MTLDepthStencilDescriptor {
18  pub unsafe fn set_depth_compare_function(&self, function: MTLCompareFunction) {
19    msg_send![self, setDepthCompareFunction:function]
20  }
21
22  pub unsafe fn set_depth_write_enabled(&self, enabled: bool) {
23    let enabled_native: objc::runtime::BOOL = enabled.into();
24    msg_send![self, setDepthWriteEnabled:enabled_native]
25  }
26}