D3DDECLTYPE enumeration

Defines a vertex declaration data type.

Syntax

typedef enum D3DDECLTYPE { 
  D3DDECLTYPE_FLOAT1     = 0,
  D3DDECLTYPE_FLOAT2     = 1,
  D3DDECLTYPE_FLOAT3     = 2,
  D3DDECLTYPE_FLOAT4     = 3,
  D3DDECLTYPE_D3DCOLOR   = 4,
  D3DDECLTYPE_UBYTE4     = 5,
  D3DDECLTYPE_SHORT2     = 6,
  D3DDECLTYPE_SHORT4     = 7,
  D3DDECLTYPE_UBYTE4N    = 8,
  D3DDECLTYPE_SHORT2N    = 9,
  D3DDECLTYPE_SHORT4N    = 10,
  D3DDECLTYPE_USHORT2N   = 11,
  D3DDECLTYPE_USHORT4N   = 12,
  D3DDECLTYPE_UDEC3      = 13,
  D3DDECLTYPE_DEC3N      = 14,
  D3DDECLTYPE_FLOAT16_2  = 15,
  D3DDECLTYPE_FLOAT16_4  = 16,
  D3DDECLTYPE_UNUSED     = 17
} D3DDECLTYPE, *LPD3DDECLTYPE;

Constants

D3DDECLTYPE_FLOAT1

One-component float expanded to (float, 0, 0, 1).

D3DDECLTYPE_FLOAT2

Two-component float expanded to (float, float, 0, 1).

D3DDECLTYPE_FLOAT3

Three-component float expanded to (float, float, float, 1).

D3DDECLTYPE_FLOAT4

Four-component float expanded to (float, float, float, float).

D3DDECLTYPE_D3DCOLOR

Four-component, packed, unsigned bytes mapped to 0 to 1 range. Input is a D3DCOLOR and is expanded to RGBA order.

D3DDECLTYPE_UBYTE4

Four-component, unsigned byte.

D3DDECLTYPE_SHORT2

Two-component, signed short expanded to (value, value, 0, 1).

D3DDECLTYPE_SHORT4

Four-component, signed short expanded to (value, value, value, value).

D3DDECLTYPE_UBYTE4N

Four-component byte with each byte normalized by dividing with 255.0f.

D3DDECLTYPE_SHORT2N

Normalized, two-component, signed short, expanded to (first short/32767.0, second short/32767.0, 0, 1).

D3DDECLTYPE_SHORT4N

Normalized, four-component, signed short, expanded to (first short/32767.0, second short/32767.0, third short/32767.0, fourth short/32767.0).

D3DDECLTYPE_USHORT2N

Normalized, two-component, unsigned short, expanded to (first short/65535.0, short short/65535.0, 0, 1).

D3DDECLTYPE_USHORT4N

Normalized, four-component, unsigned short, expanded to (first short/65535.0, second short/65535.0, third short/65535.0, fourth short/65535.0).

D3DDECLTYPE_UDEC3

Three-component, unsigned, 10 10 10 format expanded to (value, value, value, 1).

D3DDECLTYPE_DEC3N

Three-component, signed, 10 10 10 format normalized and expanded to (v[0]/511.0, v[1]/511.0, v[2]/511.0, 1).

D3DDECLTYPE_FLOAT16_2

Two-component, 16-bit, floating point expanded to (value, value, 0, 1).

D3DDECLTYPE_FLOAT16_4

Four-component, 16-bit, floating point expanded to (value, value, value, value).

D3DDECLTYPE_UNUSED

Type field in the declaration is unused. This is designed for use with D3DDECLMETHOD_UV and D3DDECLMETHOD_LOOKUPPRESAMPLED.

Remarks

Vertex data is declared with an array of D3DVERTEXELEMENT9 structures. Each element in the array contains a vertex declaration data type.

Use the DirectX Caps Viewer Tool (DXCapsViewer.exe) to see which types are supported on your device. You can get this tool and learn about it from the DirectX SDK. For info about the DirectX SDK, see Where is the DirectX SDK?.

Requirements

Requirement Value
Header
D3D9Types.h

See also

Direct3D Enumerations

D3DDECLMETHOD