Table of Contents

Struct VertexBufferBinding

Namespace
Stride.Graphics
Assembly
Stride.Graphics.dll

Binding structure that specifies a Vertex Buffer and other per-vertex parameters (such as offset and instancing) for a Graphics Device.

[DataSerializer(typeof(VertexBufferBinding.Serializer))]
public readonly struct VertexBufferBinding : IEquatable<VertexBufferBinding>
Implements
Inherited Members
Extension Methods

Constructors

VertexBufferBinding(Buffer, VertexDeclaration, int, int, int)

Initializes a new instance of the VertexBufferBinding structure.

public VertexBufferBinding(Buffer vertexBuffer, VertexDeclaration vertexDeclaration, int vertexCount, int vertexStride = -1, int vertexOffset = 0)

Parameters

vertexBuffer Buffer

The Vertex Buffer to bind.

vertexDeclaration VertexDeclaration

A description of the layout of the vertices in the vertexBuffer, defining how the data is structured.

vertexCount int

The number of vertices in the Buffer to use.

vertexStride int

The size of a single vertex in bytes. This is the distance between two consecutive vertices in the buffer. Specify -1 to auto-discover the stride from the vertexDeclaration.

vertexOffset int

The offset in bytes from the beginning of the Buffer to the first vertex to use. Default is 0, meaning the first vertex in the Buffer will be used.

Exceptions

ArgumentNullException

vertexBuffer or vertexDeclaration is null.

Properties

Buffer

Gets the Vertex Buffer to bind.

public Buffer Buffer { get; }

Property Value

Buffer

Count

Gets the number of vertices in the Buffer to use.

public int Count { get; }

Property Value

int

Declaration

Gets a description of the layout of the vertices in the Buffer, defining how the data is structured.

public VertexDeclaration Declaration { get; }

Property Value

VertexDeclaration

Offset

Gets the offset in bytes from the beginning of the Buffer to the first vertex to use.

public int Offset { get; }

Property Value

int

Stride

Gets the size of a single vertex in bytes. This is the distance between two consecutive vertices in the Buffer.

public int Stride { get; }

Property Value

int

Methods

Equals(VertexBufferBinding)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(VertexBufferBinding other)

Parameters

other VertexBufferBinding

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Operators

operator ==(VertexBufferBinding, VertexBufferBinding)

public static bool operator ==(VertexBufferBinding left, VertexBufferBinding right)

Parameters

left VertexBufferBinding
right VertexBufferBinding

Returns

bool

operator !=(VertexBufferBinding, VertexBufferBinding)

public static bool operator !=(VertexBufferBinding left, VertexBufferBinding right)

Parameters

left VertexBufferBinding
right VertexBufferBinding

Returns

bool