D3DPRIMITIVETYPE

The D3DPRIMITIVETYPE enumerated type lists the primitives supported by DrawPrimitive methods. This type was introduced in DirectX 5.0.

typedef enum _D3DPRIMITIVETYPE { 
    D3DPT_POINTLIST     = 1, 
    D3DPT_LINELIST      = 2, 
    D3DPT_LINESTRIP     = 3, 
    D3DPT_TRIANGLELIST  = 4, 
    D3DPT_TRIANGLESTRIP = 5, 
    D3DPT_TRIANGLEFAN   = 6 
    D3DPT_FORCE_DWORD   = 0x7fffffff, 
} D3DPRIMITIVETYPE; 
 

Members

D3DPT_POINTLIST
Renders the vertices as a collection of isolated points.
D3DPT_LINELIST
Renders the vertices as a list of isolated straight line segments. Calls using this primitive type will fail if the count is less than 2, or is odd.
D3DPT_LINESTRIP
Renders the vertices as a single polyline. Calls using this primitive type will fail if the count is less than 2.
D3DPT_TRIANGLELIST
Renders the specified vertices as a sequence of isolated triangles. Each group of 3 vertices defines a separate triangle. Calls using this primitive type will fail if the count is less than 3, or if not evenly divisible by 3.

Backface culling is affected by the current winding order render state.

D3DPT_TRIANGLESTRIP
Renders the vertices as a triangle strip. Calls using this primitive type will fail if the count is less than 3. The backface removal flag is automatically flipped on even numbered triangles.
D3DPT_TRIANGLEFAN
Renders the vertices as a triangle fan. Calls using this primitive type will fail if the count is less than 3.
D3DPT_FORCE_DWORD
Forces this enumerated type to be 32 bits in size.

Remarks

Using triangle strips or fans is often more effecient than using triangle lists, as fewer vertices are duplicated. For a conceptual overview and information about defining triangle strips and fans, see Triangle Strips and Triangle Fans.

QuickInfo

  Windows NT/2000: Requires Windows NT 4.0 SP3 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in d3dtypes.h.

See Also

IDirect3DDevice3::Begin, IDirect3DDevice3::BeginIndexed, IDirect3DDevice3::DrawIndexedPrimitive, IDirect3DDevice3::DrawPrimitive, Primitive Types