D3DVERTEXELEMENT9 structure

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

Syntax

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

Members

Stream

Type: WORD

Stream number.

Offset

Type: WORD

Offset from the beginning of the vertex data to the data associated with the particular data type.

Type

Type: BYTE

The data type, specified as a D3DDECLTYPE. One of several predefined types that define the data size. Some methods have an implied type.

Method

Type: BYTE

The method specifies the tessellator processing, which determines how the tessellator interprets (or operates on) the vertex data. For more information, see D3DDECLMETHOD.

Usage

Type: BYTE

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

Type: BYTE

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.

Requirements

Requirement Value
Header
D3D9Types.h

See also

Direct3D Structures

Vertex Declaration (Direct3D 9)