Struct VertexBufferBinding
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
vertexBufferBufferThe Vertex Buffer to bind.
vertexDeclarationVertexDeclarationA description of the layout of the vertices in the
vertexBuffer, defining how the data is structured.vertexCountintThe number of vertices in the Buffer to use.
vertexStrideintThe size of a single vertex in bytes. This is the distance between two consecutive vertices in the buffer. Specify
-1to auto-discover the stride from thevertexDeclaration.vertexOffsetintThe 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
vertexBufferorvertexDeclarationis null.
Properties
Buffer
Gets the Vertex Buffer to bind.
public Buffer Buffer { get; }
Property Value
Count
Gets the number of vertices in the Buffer to use.
public int Count { get; }
Property Value
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
Offset
Gets the offset in bytes from the beginning of the Buffer to the first vertex to use.
public int Offset { get; }
Property Value
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
Methods
Equals(VertexBufferBinding)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(VertexBufferBinding other)
Parameters
otherVertexBufferBindingAn object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
leftVertexBufferBindingrightVertexBufferBinding
Returns
operator !=(VertexBufferBinding, VertexBufferBinding)
public static bool operator !=(VertexBufferBinding left, VertexBufferBinding right)
Parameters
leftVertexBufferBindingrightVertexBufferBinding