Struct VertexElement
Defines a single element in a vertex.
public struct VertexElement : IEquatable<VertexElement>
- Implements
- Inherited Members
Constructors
VertexElement(int, VertexElementFormat, VertexElementUsage, int)
Initializes a new instance of the VertexElement struct.
public VertexElement(int offset, VertexElementFormat elementFormat, VertexElementUsage elementUsage, int usageIndex)
Parameters
offset
intThe offset in bytes from the beginning of the stream to the vertex element.
elementFormat
VertexElementFormatThe element format.
elementUsage
VertexElementUsageThe HLSL semantic of the element in the vertex shader input-signature.
usageIndex
intThe semantic index, which is required if the semantic is used for more than one vertex element.
Properties
Offset
Gets or sets the offset in bytes from the beginning of the stream to the vertex element.
public int Offset { get; set; }
Property Value
- int
The offset in bytes.
UsageIndex
Gets or sets the semantic index.
public int UsageIndex { get; set; }
Property Value
- int
The semantic index, which is required if the semantic is used for more than one vertex element.
Remarks
Usage indices in a vertex declaration usually start with 0. When multiple vertex buffers are bound to the input assembler stage (see SetVertexBuffers(params VertexBufferBinding[])), MonoGame internally adjusts the usage indices based on the order in which the vertex buffers are bound.
VertexElementFormat
Gets or sets the data format.
public VertexElementFormat VertexElementFormat { get; set; }
Property Value
- VertexElementFormat
The data format.
VertexElementUsage
Gets or sets the HLSL semantic of the element in the vertex shader input.
public VertexElementUsage VertexElementUsage { get; set; }
Property Value
- VertexElementUsage
The HLSL semantic of the element in the vertex shader input.
Methods
Equals(VertexElement)
Determines whether the specified VertexElement is equal to this instance.
public bool Equals(VertexElement other)
Parameters
other
VertexElementThe object to compare with the current object.
Returns
- bool
true if the specified VertexElement is equal to this instance; otherwise, false.
Equals(object)
Determines whether the specified object is equal to this instance.
public override bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
GetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()
Returns
- int
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
ToString()
Returns a string that represents this instance.
public override string ToString()
Returns
Operators
operator ==(VertexElement, VertexElement)
Compares two VertexElement instances to determine whether they are the same.
public static bool operator ==(VertexElement left, VertexElement right)
Parameters
left
VertexElementThe first instance.
right
VertexElementThe second instance.
Returns
operator !=(VertexElement, VertexElement)
Compares two VertexElement instances to determine whether they are different.
public static bool operator !=(VertexElement left, VertexElement right)
Parameters
left
VertexElementThe first instance.
right
VertexElementThe second instance.