pub struct VertexAttributeDescriptor(/* private fields */);Expand description
Describes a vertex attribute in a vertex descriptor.
C++ equivalent: MTL::VertexAttributeDescriptor
Implementations§
Source§impl VertexAttributeDescriptor
impl VertexAttributeDescriptor
Sourcepub fn new() -> Option<Self>
pub fn new() -> Option<Self>
Create a new vertex attribute descriptor.
C++ equivalent: static VertexAttributeDescriptor* 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 VertexAttributeDescriptor from a raw pointer.
§Safety
The pointer must be a valid Metal vertex attribute descriptor object.
Sourcepub fn format(&self) -> VertexFormat
pub fn format(&self) -> VertexFormat
Get the format of the vertex attribute.
C++ equivalent: VertexFormat format() const
Sourcepub fn set_format(&self, format: VertexFormat)
pub fn set_format(&self, format: VertexFormat)
Set the format of the vertex attribute.
C++ equivalent: void setFormat(MTL::VertexFormat format)
Sourcepub fn offset(&self) -> UInteger
pub fn offset(&self) -> UInteger
Get the offset, in bytes, of this attribute in the vertex buffer.
C++ equivalent: NS::UInteger offset() const
Sourcepub fn set_offset(&self, offset: UInteger)
pub fn set_offset(&self, offset: UInteger)
Set the offset, in bytes, of this attribute in the vertex buffer.
C++ equivalent: void setOffset(NS::UInteger offset)
Sourcepub fn buffer_index(&self) -> UInteger
pub fn buffer_index(&self) -> UInteger
Get the index of the buffer that contains this attribute.
C++ equivalent: NS::UInteger bufferIndex() const
Sourcepub fn set_buffer_index(&self, buffer_index: UInteger)
pub fn set_buffer_index(&self, buffer_index: UInteger)
Set the index of the buffer that contains this attribute.
C++ equivalent: void setBufferIndex(NS::UInteger bufferIndex)