Instance Method

newBuffer(from:data:type:)

Creates a new buffer containing the specified data in the specified zone.

Required.

Declaration

func newBuffer(from zone: MDLMeshBufferZone?, data: Data, type: MDLMeshBufferType) -> MDLMeshBuffer?

Parameters

zone

A pool of memory for related allocations, as returned by the newZone(_:) method.

data

The initial data to store in the buffer. Implementations of this protocol typically copy this data.

type

Use MDLMeshBufferType.vertex to create a buffer for a mesh’s vertex attribute data, or MDLMeshBufferType.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.

See Also

Allocating Mesh Buffers

func newZone(Int) -> MDLMeshBufferZone

Creates a zone for related memory allocations.

Required.

func newZoneForBuffers(withSize: [NSNumber], andType: [NSNumber]) -> MDLMeshBufferZone

Creates a zone large enough to fit the specified group of allocation sizes.

Required.

func newBuffer(Int, type: MDLMeshBufferType) -> MDLMeshBuffer

Creates a new buffer of the specified length.

Required.

func newBuffer(from: MDLMeshBufferZone?, length: Int, type: MDLMeshBufferType) -> MDLMeshBuffer?

Creates a new buffer of the specified length in the specified zone.

Required.

func newBuffer(with: Data, type: MDLMeshBufferType) -> MDLMeshBuffer

Creates a new buffer containing the specified data.

Required.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software