pub struct DepthStencilDescriptor(/* private fields */);Expand description
A configuration for depth and stencil test operations.
C++ equivalent: MTL::DepthStencilDescriptor
Implementations§
Source§impl DepthStencilDescriptor
impl DepthStencilDescriptor
Sourcepub fn new() -> Option<Self>
pub fn new() -> Option<Self>
Create a new depth/stencil descriptor.
C++ equivalent: static DepthStencilDescriptor* alloc()->init()
Sourcepub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
Create a DepthStencilDescriptor from a raw pointer.
§Safety
The pointer must be a valid Metal depth/stencil descriptor object.
Sourcepub fn depth_compare_function(&self) -> CompareFunction
pub fn depth_compare_function(&self) -> CompareFunction
Get the depth compare function.
C++ equivalent: CompareFunction depthCompareFunction() const
Sourcepub fn set_depth_compare_function(&self, func: CompareFunction)
pub fn set_depth_compare_function(&self, func: CompareFunction)
Set the depth compare function.
C++ equivalent: void setDepthCompareFunction(CompareFunction)
Sourcepub fn is_depth_write_enabled(&self) -> bool
pub fn is_depth_write_enabled(&self) -> bool
Check if depth write is enabled.
C++ equivalent: bool isDepthWriteEnabled() const
Sourcepub fn set_depth_write_enabled(&self, enabled: bool)
pub fn set_depth_write_enabled(&self, enabled: bool)
Set whether depth write is enabled.
C++ equivalent: void setDepthWriteEnabled(bool)
Sourcepub fn front_face_stencil(&self) -> Option<StencilDescriptor>
pub fn front_face_stencil(&self) -> Option<StencilDescriptor>
Get the front face stencil descriptor.
C++ equivalent: StencilDescriptor* frontFaceStencil() const
Sourcepub fn set_front_face_stencil(&self, stencil: Option<&StencilDescriptor>)
pub fn set_front_face_stencil(&self, stencil: Option<&StencilDescriptor>)
Set the front face stencil descriptor.
C++ equivalent: void setFrontFaceStencil(StencilDescriptor*)
Sourcepub fn back_face_stencil(&self) -> Option<StencilDescriptor>
pub fn back_face_stencil(&self) -> Option<StencilDescriptor>
Get the back face stencil descriptor.
C++ equivalent: StencilDescriptor* backFaceStencil() const
Sourcepub fn set_back_face_stencil(&self, stencil: Option<&StencilDescriptor>)
pub fn set_back_face_stencil(&self, stencil: Option<&StencilDescriptor>)
Set the back face stencil descriptor.
C++ equivalent: void setBackFaceStencil(StencilDescriptor*)