Table of Contents

Struct VertexElement

Namespace
Microsoft.Xna.Framework.Graphics
Assembly
MonoGame.Framework.dll

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 int

The offset in bytes from the beginning of the stream to the vertex element.

elementFormat VertexElementFormat

The element format.

elementUsage VertexElementUsage

The HLSL semantic of the element in the vertex shader input-signature.

usageIndex int

The 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 VertexElement

The 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 object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to this instance; otherwise, false.

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

string

A string that represents this instance.

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 VertexElement

The first instance.

right VertexElement

The second instance.

Returns

bool

true if the left and right are the same; otherwise, false.

operator !=(VertexElement, VertexElement)

Compares two VertexElement instances to determine whether they are different.

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

Parameters

left VertexElement

The first instance.

right VertexElement

The second instance.

Returns

bool

true if the left and right are the different; otherwise, false.