pub unsafe trait MDLMeshBuffer: NSObjectProtocol + NSCopying {
// Provided methods
unsafe fn fillData_offset(&self, data: &NSData, offset: NSUInteger)
where Self: Sized + Message { ... }
unsafe fn map(&self) -> Retained<MDLMeshBufferMap>
where Self: Sized + Message { ... }
unsafe fn length(&self) -> NSUInteger
where Self: Sized + Message { ... }
unsafe fn allocator(
&self,
) -> Retained<ProtocolObject<dyn MDLMeshBufferAllocator>>
where Self: Sized + Message { ... }
unsafe fn zone(&self) -> Retained<ProtocolObject<dyn MDLMeshBufferZone>>
where Self: Sized + Message { ... }
unsafe fn type(&self) -> MDLMeshBufferType
where Self: Sized + Message { ... }
}MDLMeshBuffer only.Expand description
Used by ModelIO to represent a buffer to be filled with vertex and index data
Supports deep copy of data by conforming to the NSCopying protocol
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn fillData_offset(&self, data: &NSData, offset: NSUInteger)
unsafe fn fillData_offset(&self, data: &NSData, offset: NSUInteger)
Fills buffer with data at offset
Parameter data: Data to fill buffer with
Parameter offset: Byte offset in buffer to begin filling data
Fills data.length bytes of data. Will not write beyond length of this buffer.
Sourceunsafe fn map(&self) -> Retained<MDLMeshBufferMap>
unsafe fn map(&self) -> Retained<MDLMeshBufferMap>
CPU access to buffer’s memory
Returns: An MDLMeshBufferMap object to read or modify a buffer’s memory
The buffer will remain mapped as long as the returned MDLMeshBufferMap object exists. Mapping a buffer may impose restrictions on a system. For instance, if the implementing class maps an OpenGL buffer, that buffer may be unavailable for rendering while mapped, and cause a draw failure. Precautions must be taken in such cases.
Sourceunsafe fn length(&self) -> NSUInteger
unsafe fn length(&self) -> NSUInteger
Size in bytes of the buffer allocation
Sourceunsafe fn allocator(
&self,
) -> Retained<ProtocolObject<dyn MDLMeshBufferAllocator>>
unsafe fn allocator( &self, ) -> Retained<ProtocolObject<dyn MDLMeshBufferAllocator>>
Allocator object used to create this buffer.
This allcoator used for copy and relayout operations (such as when a new vertex descriptor is applied to a vertex buffer)
Sourceunsafe fn zone(&self) -> Retained<ProtocolObject<dyn MDLMeshBufferZone>>
unsafe fn zone(&self) -> Retained<ProtocolObject<dyn MDLMeshBufferZone>>
Zone from which this buffer was created
This zone will be used for copy and relayout operations (such as when a new vertex descriptor is applied to a vertex buffer). If the default zone is used this will be nil.
Sourceunsafe fn type(&self) -> MDLMeshBufferType
unsafe fn type(&self) -> MDLMeshBufferType
the intended type of the buffer