Initializer

init(vertexBuffer:vertexCount:descriptor:submeshes:)

Creates a mesh from a single vertex buffer with the specified parameters.

Declaration

init(vertexBuffer: MDLMeshBuffer, vertexCount: Int, descriptor: MDLVertexDescriptor, submeshes: [MDLSubmesh])

Parameters

vertexBuffer

The source of vertex information for the mesh.

vertexCount

The number of vertices in the mesh.

descriptor

An object describing the type and layout of vertex attribute data in the vertex buffer.

submeshes

An array of submesh objects, each of which provides index buffer and material information describing how some or all of the mesh’s vertex data is to be rendered.

Return Value

A new mesh object.

Discussion

Use this initializer to create a mesh from vertex data that describes multiple vertex attributes in the same array (that is, in an array of structures).