public interface MDLMeshBufferAllocator
Object for allocating buffers to back vertex and index data
Accepted by MDLAsset init method. Implementor creates objects implementing MDLMeshBuffer with memory to be filled with vertex and index data during 3d file loading and parsing.
| Modifier and Type | Method and Description |
|---|---|
MDLMeshBuffer |
newBufferFromZoneDataType(MDLMeshBufferZone zone,
NSData data,
long type)
newBufferFromZone:data:type:
|
MDLMeshBuffer |
newBufferFromZoneLengthType(MDLMeshBufferZone zone,
long length,
long type)
newBufferFromZone:length:type:
|
MDLMeshBuffer |
newBufferType(long length,
long type)
newBuffer:type:
|
MDLMeshBuffer |
newBufferWithDataType(NSData data,
long type)
newBufferWithData:type:
|
MDLMeshBufferZone |
newZone(long capacity)
newZone:
|
MDLMeshBufferZone |
newZoneForBuffersWithSizeAndType(NSArray<? extends NSNumber> sizes,
NSArray<? extends NSNumber> types)
newZoneForBuffersWithSize:andType:
|
MDLMeshBuffer newBufferType(long length, long type)
Create a buffer in a default zone
length - Size of buffer to be created in bytestype - Type of data to be stored in this bufferMDLMeshBuffer newBufferFromZoneDataType(MDLMeshBufferZone zone, NSData data, long type)
Create a buffer from a given zone and fill with data in the supplied NSData object
An implementing MDLMeshBufferAllocator object may increase the size of the zone if the buffer could not be allocated with the current zone size. Alternatively the implementation may return nil if the buffer could not be allocated.
zone - Zone from which to allocate the memorydata - Values with which to fill the buffertype - Type of data to be stored in this bufferMDLMeshBuffer newBufferFromZoneLengthType(MDLMeshBufferZone zone, long length, long type)
Create a buffer from a given zone with the given length
An implementing MDLMeshBufferAllocator object may increase the size of the zone if the buffer could not be allocated with the current zone size. Alternatively the implementation may return nil if the buffer could not be allocated.
zone - Zone from which to allocate the memorytype - Type of data to be stored in this bufferMDLMeshBuffer newBufferWithDataType(NSData data, long type)
Create a buffer in a default zone and fill with data in the supplied NSData object
data - Memory to fill the buffer withtype - Type of data to be stored in this bufferMDLMeshBufferZone newZone(long capacity)
Create a zone which can be used to allocate MDLMeshBuffer objects
capacity - Total size in bytes of all buffers which can be created from
this zoneMDLMeshBufferZone newZoneForBuffersWithSizeAndType(NSArray<? extends NSNumber> sizes, NSArray<? extends NSNumber> types)
Create a zone which can be used to allocate MDLMeshBuffer objects
Will create a zone from which MDLMeshBuffer objects can be allocated. This will allocate a zone with enough capacity for each of the buffers with sizes and types specified even taking into any alignment restrictions necessary to use these buffers.
sizes - Sizes of each buffer to be created in this zonetypes - Type of each buffer to be created in this zone. Values to be of
MDLMeshBufferType