The D3DTRIANGLE structure describes the base type for all triangles. The triangle is the main rendering primitive.
For related information, see the D3DOP_TRIANGLE member in the D3DOPCODE enumerated type.
typedef struct _D3DTRIANGLE {
union {
WORD v1;
WORD wV1;
};
union {
WORD v2;
WORD wV2;
};
union {
WORD v3;
WORD wV3;
};
WORD wFlags;
} D3DTRIANGLE, *LPD3DTRIANGLE;
Edge flags
These flags describe which edges of the triangle to enable. (This information is useful only in wireframe mode.)
Strip and fan flags
This length must be greater than zero and less than 30.
This structure can be used directly for all triangle fills. For flat shading, the color and specular components are taken from the first vertex. The three vertex indices v1, v2, and v3 are vertex indexes into the vertex list at the start of the execute buffer.
Enabled edges are visible in wireframe mode. When an application displays wireframe triangles that share an edge, it typically enables only one (or neither) edge to avoid drawing the edge twice.
The D3DTRIFLAG_ODD and D3DTRIFLAG_EVEN flags refer to the locations of a triangle in a conventional triangle strip or fan. If a triangle strip had five triangles, the following flags would be used to define the strip:
D3DTRIFLAG_START
D3DTRIFLAG_ODD
D3DTRIFLAG_EVEN
D3DTRIFLAG_ODD
D3DTRIFLAG_EVEN
Similarly, the following flags would define a triangle fan with five triangles:
D3DTRIFLAG_START
D3DTRIFLAG_EVEN
D3DTRIFLAG_EVEN
D3DTRIFLAG_EVEN
D3DTRIFLAG_EVEN
The following flags could define a flat triangle fan with five triangles:
D3DTRIFLAG_STARTFLAT(4)
D3DTRIFLAG_EVEN
D3DTRIFLAG_EVEN
D3DTRIFLAG_EVEN
D3DTRIFLAG_EVEN
For more information, see Triangle Strips and Triangle Fans.
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.