Table of Contents

Struct VertexBufferBinding

Namespace
Microsoft.Xna.Framework.Graphics
Assembly
MonoGame.Framework.dll

Defines how a vertex buffer is bound to the graphics device for rendering.

public struct VertexBufferBinding
Inherited Members

Constructors

VertexBufferBinding(VertexBuffer)

Creates an instance of VertexBufferBinding.

public VertexBufferBinding(VertexBuffer vertexBuffer)

Parameters

vertexBuffer VertexBuffer

The vertex buffer to bind.

VertexBufferBinding(VertexBuffer, int)

Creates an instance of VertexBufferBinding.

public VertexBufferBinding(VertexBuffer vertexBuffer, int vertexOffset)

Parameters

vertexBuffer VertexBuffer

The vertex buffer to bind.

vertexOffset int

The index of the first vertex in the vertex buffer to use.

VertexBufferBinding(VertexBuffer, int, int)

Creates an instance of VertexBufferBinding.

public VertexBufferBinding(VertexBuffer vertexBuffer, int vertexOffset, int instanceFrequency)

Parameters

vertexBuffer VertexBuffer

The vertex buffer to bind.

vertexOffset int

The index of the first vertex in the vertex buffer to use.

instanceFrequency int

The number of instances to draw using the same per-instance data before advancing in the buffer by one element. This value must be 0 for an element that contains per-vertex data and greater than 0 for per-instance data.

Exceptions

ArgumentNullException

vertexBuffer is null.

ArgumentOutOfRangeException

vertexOffset or instanceFrequency is invalid.

Properties

InstanceFrequency

Gets the number of instances to draw using the same per-instance data before advancing in the buffer by one element.

public int InstanceFrequency { get; }

Property Value

int

The number of instances to draw using the same per-instance data before advancing in the buffer by one element. This value must be 0 for an element that contains per-vertex data and greater than 0 for per-instance data.

VertexBuffer

Gets the vertex buffer.

public VertexBuffer VertexBuffer { get; }

Property Value

VertexBuffer

The vertex buffer.

VertexOffset

Gets the index of the first vertex in the vertex buffer to use.

public int VertexOffset { get; }

Property Value

int

The index of the first vertex in the vertex buffer to use.