VertexDeclaration Class
Namespace: Stride.GraphicsAssembly: Stride.Graphics.dll
The layout of a vertex buffer with a set of VertexElement.
[DataContract]
[DataSerializer(typeof(VertexDeclaration.Serializer))]
public class VertexDeclaration : IEquatable<VertexDeclaration>
Name | Description | |
---|---|---|
Constructors | ||
VertexDeclaration(VertexElement[]) | Initializes a new instance of the VertexDeclaration class. |
|
VertexDeclaration(VertexElement[], Int32, Int32) | Initializes a new instance of the VertexDeclaration class. |
|
Properties | ||
InstanceCount | Gets the instance count. |
|
VertexElements | Gets the vertex elements. |
|
VertexStride | Gets the vertex stride. |
|
Methods | ||
CalculateSize() | Calculate the size of the vertex declaration. |
|
EnumerateWithOffsets() | Enumerates VertexElement with declared offsets. |
|
Equals(VertexDeclaration) | ||
Equals(Object) | ||
GetHashCode() | ||
Operators | ||
Implicit(VertexElement to VertexDeclaration) | Performs an implicit conversion from VertexElement to VertexDeclaration. |
|
Implicit(VertexElement[] to VertexDeclaration) | Performs an implicit conversion from VertexElement to VertexDeclaration. |
Constructors
VertexDeclaration(VertexElement[])
Initializes a new instance of the VertexDeclaration class.
public VertexDeclaration(params VertexElement[] elements)
Parameters
Type | Name | Description |
---|---|---|
VertexElement[] | elements | The elements. |
VertexDeclaration(VertexElement[], Int32, Int32)
Initializes a new instance of the VertexDeclaration class.
public VertexDeclaration(VertexElement[] elements, int instanceCount, int vertexStride)
Parameters
Type | Name | Description |
---|---|---|
VertexElement[] | elements | The elements. |
System.Int32 | instanceCount | The instance count. |
System.Int32 | vertexStride | The vertex stride. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | elements |
Properties
InstanceCount
Gets the instance count.
public int InstanceCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The instance count. |
VertexElements
Gets the vertex elements.
public VertexElement[] VertexElements { get; }
Property Value
Type | Description |
---|---|
VertexElement[] | The vertex elements. |
VertexStride
Gets the vertex stride.
public int VertexStride { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The vertex stride. |
Methods
CalculateSize()
Calculate the size of the vertex declaration.
public int CalculateSize()
Returns
Type | Description |
---|---|
System.Int32 | The size in bytes of the vertex declaration |
EnumerateWithOffsets()
Enumerates VertexElement with declared offsets.
public IEnumerable<VertexElementWithOffset> EnumerateWithOffsets()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<VertexElementWithOffset> | A set of VertexElement with offsets. |
Equals(VertexDeclaration)
public bool Equals(VertexDeclaration other)
Parameters
Type | Name | Description |
---|---|---|
VertexDeclaration | other |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Object)
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
GetHashCode()
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
Operators
Implicit(VertexElement to VertexDeclaration)
Performs an implicit conversion from VertexElement to VertexDeclaration.
public static implicit operator VertexDeclaration(VertexElement element)
Parameters
Type | Name | Description |
---|---|---|
VertexElement | element | The element. |
Returns
Type | Description |
---|---|
VertexDeclaration | The result of the conversion. |
Implicit(VertexElement[] to VertexDeclaration)
Performs an implicit conversion from VertexElement to VertexDeclaration.
public static implicit operator VertexDeclaration(VertexElement[] elements)
Parameters
Type | Name | Description |
---|---|---|
VertexElement[] | elements | The elements. |
Returns
Type | Description |
---|---|
VertexDeclaration | The result of the conversion. |