D3DVERTEXELEMENT9

Defines the vertex data layout. Each vertex can contain one or more data types, and each data type is described by a vertex element.

typedef struct D3DVERTEXELEMENT9 {
    WORD Stream;
    WORD Offset;
    BYTE Type;
    BYTE Method;
    BYTE Usage;
    BYTE UsageIndex;
} D3DVERTEXELEMENT9, *LPD3DVERTEXELEMENT9;

Members

Stream
Stream number.
Offset
Offset from the beginning of the vertex data to the data associated with the particular data type.
Type
The data type, specified as a D3DDECLTYPE. One of several predefined types that define the data size. Some methods have an implied type.
Method
The method specifies the tessellator processing, which determines how the tessellator interprets (or operates on) the vertex data. For more information, see D3DDECLMETHOD.
Usage
Defines what the data will be used for; that is, the interoperability between vertex data layouts and vertex shaders. Each usage acts to bind a vertex declaration to a vertex shader. In some cases, they have a special interpretation. For example, an element that specifies D3DDECLUSAGE_NORMAL or D3DDECLUSAGE_POSITION is used by the N-patch tessellator to set up tessellation. See D3DDECLUSAGE for a list of the available semantics. D3DDECLUSAGE_TEXCOORD can be used for user-defined fields (which don't have an existing usage defined).
UsageIndex
Modifies the usage data to allow the user to specify multiple usage types.

Remarks

Vertex data is defined using an array of D3DVERTEXELEMENT9 structures. Use D3DDECL_END to declare the last element in the declaration.

See Also

Vertex Declaration