Class VertexDeclaration
The layout of a vertex buffer with a set of VertexElement.
[DataContract]
[DataSerializer(typeof(VertexDeclaration.Serializer))]
public class VertexDeclaration : IEquatable<VertexDeclaration>- Inheritance
- 
      objectVertexDeclaration
- Implements
- Extension Methods
Constructors
VertexDeclaration(params VertexElement[])
Initializes a new instance of the VertexDeclaration class.
public VertexDeclaration(params VertexElement[] elements)Parameters
- elementsVertexElement[]
- The elements. 
VertexDeclaration(VertexElement[], int, int)
Initializes a new instance of the VertexDeclaration class.
public VertexDeclaration(VertexElement[] elements, int instanceCount, int vertexStride)Parameters
- elementsVertexElement[]
- The elements. 
- instanceCountint
- The instance count. 
- vertexStrideint
- The vertex stride. 
Exceptions
- ArgumentNullException
- elements 
Properties
InstanceCount
Gets the instance count.
public int InstanceCount { get; }Property Value
- int
- The instance count. 
VertexElements
Gets the vertex elements.
[DataMember]
public VertexElement[] VertexElements { get; }Property Value
- VertexElement[]
- The vertex elements. 
VertexStride
Gets the vertex stride.
public int VertexStride { get; }Property Value
- int
- The vertex stride. 
Methods
CalculateSize()
Calculate the size of the vertex declaration.
public int CalculateSize()Returns
- int
- The size in bytes of the vertex declaration 
EnumerateWithOffsets()
Enumerates VertexElement with declared offsets.
public IEnumerable<VertexElementWithOffset> EnumerateWithOffsets()Returns
- IEnumerable<VertexElementWithOffset>
- A set of VertexElement with offsets. 
Equals(VertexDeclaration)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(VertexDeclaration other)Parameters
- otherVertexDeclaration
- An object to compare with this object. 
Returns
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)Parameters
- objobject
- The object to compare with the current object. 
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()Returns
- int
- A hash code for the current object. 
Operators
implicit operator VertexDeclaration(VertexElement)
Performs an implicit conversion from VertexElement to VertexDeclaration.
public static implicit operator VertexDeclaration(VertexElement element)Parameters
- elementVertexElement
- The element. 
Returns
- VertexDeclaration
- The result of the conversion. 
implicit operator VertexDeclaration(VertexElement[])
Performs an implicit conversion from VertexElement to VertexDeclaration.
public static implicit operator VertexDeclaration(VertexElement[] elements)Parameters
- elementsVertexElement[]
- The elements. 
Returns
- VertexDeclaration
- The result of the conversion.