newBuffer(from:length:type:)
Creates a new buffer of the specified length in the specified zone.
Declaration
func newBuffer(from zone: (any MDLMeshBufferZone)?, length: Int, type: MDLMeshBufferType) -> (any MDLMeshBuffer)?Parameters
- zone:
A pool of memory for related allocations, as returned by the Newzone(_:) method.
- length:
The size, in bytes, of the buffer to create.
- type:
Use Vertex to create a buffer for a mesh’s vertex attribute data, or Index to create a buffer for a submesh’s index data.
Return Value
A new memory buffer for mesh data.
Discussion
Use this method when making multiple related allocations that should share the same memory pool.
The concrete class implementing this protocol determines the initial contents of the buffer.