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. API-Since: 9.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @Nullable MDLMeshBuffernewBufferFromZoneDataType(@Nullable MDLMeshBufferZone zone, @NotNull 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.@Nullable MDLMeshBuffernewBufferFromZoneLengthType(@Nullable 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.@NotNull MDLMeshBuffernewBufferType(long length, long type)newBuffer:type: Create a buffer in a default zone@NotNull MDLMeshBuffernewBufferWithDataType(@NotNull NSData data, long type)newBufferWithData:type: Create a buffer in a default zone and fill with data in the supplied NSData object@NotNull MDLMeshBufferZonenewZone(long capacity)newZone: Create a zone which can be used to allocate MDLMeshBuffer objects@NotNull MDLMeshBufferZonenewZoneForBuffersWithSizeAndType(@NotNull NSArray<? extends NSNumber> sizes, @NotNull 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
@NotNull @NotNull 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
@Nullable @Nullable MDLMeshBuffer newBufferFromZoneDataType(@Nullable @Nullable MDLMeshBufferZone zone, @NotNull @NotNull 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
@Nullable @Nullable MDLMeshBuffer newBufferFromZoneLengthType(@Nullable @Nullable 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
@NotNull @NotNull MDLMeshBuffer newBufferWithDataType(@NotNull @NotNull 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
@NotNull @NotNull 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
@NotNull @NotNull MDLMeshBufferZone newZoneForBuffersWithSizeAndType(@NotNull @NotNull NSArray<? extends NSNumber> sizes, @NotNull @NotNull 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
-
-