Package apple.modelio.protocol
Interface MDLMeshBufferAllocator
-
- All Known Implementing Classes:
GLKMeshBufferAllocator,MDLMeshBufferDataAllocator,MTKMeshBufferAllocator
public interface MDLMeshBufferAllocator[@protocol] 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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MDLMeshBuffernewBufferFromZoneDataType(MDLMeshBufferZone zone, NSData data, long type)newBufferFromZone:data: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.MDLMeshBuffernewBufferFromZoneLengthType(MDLMeshBufferZone zone, long length, long type)newBufferFromZone:length: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.MDLMeshBuffernewBufferType(long length, long type)newBuffer:type: Create a buffer in a default zoneMDLMeshBuffernewBufferWithDataType(NSData data, long type)newBufferWithData:type: Create a buffer in a default zone and fill with data in the supplied NSData objectMDLMeshBufferZonenewZone(long capacity)newZone: Create a zone which can be used to allocate MDLMeshBuffer objectsMDLMeshBufferZonenewZoneForBuffersWithSizeAndType(NSArray<? extends NSNumber> sizes, NSArray<? extends NSNumber> types)newZoneForBuffersWithSize:andType: Create a zone which can be used to allocate MDLMeshBuffer objects Will create a zone from which MDLMeshBuffer objects can be allocated.
-
-
-
Method Detail
-
newBufferType
MDLMeshBuffer newBufferType(long length, long type)
newBuffer:type: Create a buffer in a default zone- Parameters:
length- Size of buffer to be created in bytestype- Type of data to be stored in this buffer
-
newBufferFromZoneDataType
MDLMeshBuffer newBufferFromZoneDataType(MDLMeshBufferZone zone, NSData data, long type)
newBufferFromZone:data: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.- Parameters:
zone- Zone from which to allocate the memorydata- Values with which to fill the buffertype- Type of data to be stored in this buffer- Returns:
- An object conforming to the MDLMeshBuffer protocol. Returns nil the buffer could not be allocated in the given zone
-
newBufferFromZoneLengthType
MDLMeshBuffer newBufferFromZoneLengthType(MDLMeshBufferZone zone, long length, long type)
newBufferFromZone:length: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.- Parameters:
zone- Zone from which to allocate the memorytype- Type of data to be stored in this buffer- Returns:
- An object conforming to the MDLMeshBuffer protocol. Returns nil the buffer could not be allocated in the zone given.
-
newBufferWithDataType
MDLMeshBuffer newBufferWithDataType(NSData data, long type)
newBufferWithData:type: Create a buffer in a default zone and fill with data in the supplied NSData object- Parameters:
data- Memory to fill the buffer withtype- Type of data to be stored in this buffer
-
newZone
MDLMeshBufferZone newZone(long capacity)
newZone: Create a zone which can be used to allocate MDLMeshBuffer objects- Parameters:
capacity- Total size in bytes of all buffers which can be created from this zone
-
newZoneForBuffersWithSizeAndType
MDLMeshBufferZone newZoneForBuffersWithSizeAndType(NSArray<? extends NSNumber> sizes, NSArray<? extends NSNumber> types)
newZoneForBuffersWithSize:andType: 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.- Parameters:
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
-
-