MDLMeshBuffer

Trait MDLMeshBuffer 

Source
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 { ... }
}
Available on crate feature 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§

Source

unsafe fn fillData_offset(&self, data: &NSData, offset: NSUInteger)
where Self: Sized + Message,

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.

Source

unsafe fn map(&self) -> Retained<MDLMeshBufferMap>
where Self: Sized + Message,

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.

Source

unsafe fn length(&self) -> NSUInteger
where Self: Sized + Message,

Size in bytes of the buffer allocation

Source

unsafe fn allocator( &self, ) -> Retained<ProtocolObject<dyn MDLMeshBufferAllocator>>
where Self: Sized + Message,

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)

Source

unsafe fn zone(&self) -> Retained<ProtocolObject<dyn MDLMeshBufferZone>>
where Self: Sized + Message,

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.

Source

unsafe fn type(&self) -> MDLMeshBufferType
where Self: Sized + Message,

the intended type of the buffer

Trait Implementations§

Source§

impl ProtocolType for dyn MDLMeshBuffer

Source§

const NAME: &'static str = "MDLMeshBuffer"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn MDLMeshBuffer
where T: ?Sized + Message + MDLMeshBuffer,

Implementations on Foreign Types§

Source§

impl<T> MDLMeshBuffer for ProtocolObject<T>
where T: ?Sized + MDLMeshBuffer,

Implementors§