D3DHAL_DP2INDEXEDTRIANGLELIST
One or more of these structures are parsed from the command buffer by the D3dDrawPrimitives2 callback when the D3DHAL_DP2COMMAND structure's bCommand member is set to D3DDP2OP_INDEXEDTRIANGLELIST, and are used to render a sequence of unconnected triangles using vertex indices.
typedef struct _D3DHAL_DP2INDEXEDTRIANGLELIST {
WORD wV1;
WORD wV2;
WORD wV3;
WORD wFlags;
} D3DHAL_DP2INDEXEDTRIANGLELIST;
Members
- wV1
Specifies the index into the vertex buffer location containing coordinate data for the first vertex of the triangle. - wV2
Specifies the index to the vertex buffer location containing coordinate data for the second vertex of the triangle. - wV3
Specifies the index to the vertex buffer location containing coordinate data for the third vertex of the triangle. - wFlags
Are the flags that describe how the driver should render the triangle. This member can be a bitwise OR of the following values.Flag Description D3DTRIFLAG_EDGEENABLE1 The driver should render the triangle edge between wV1 and wV2 when the fill mode is D3DFILL_WIREFRAME. D3DTRIFLAG_EDGEENABLE2 The driver should render the triangle edge between wV2 and wV3 when the fill mode is D3DFILL_WIREFRAME. D3DTRIFLAG_EDGEENABLE3 The driver should render the triangle edge between wV3 and wV1 when the fill mode is D3DFILL_WIREFRAME. D3DTRIFLAG_EDGEENABLETRIANGLE The driver should render all triangle edges when the fill mode is D3DFILL_WIREFRAME.
Remarks
D3dDrawPrimitives2 should process wPrimitiveCount*3 indexes from the command buffer, processing wPrimitiveCount D3DHAL_DP2INDEXEDTRIANGLELIST structures. The value of wPrimitiveCount is specified in the D3DHAL_DP2COMMAND structure.
The driver should process a total of wPrimitiveCount*3 vertices from the vertex buffer, three vertices per triangle, for the current command. The sequence of triangles rendered is (wV10, wV20, wV30), (wV11, wV21, wV31), ..., (wV1n, wV2n, wV3n), where n equals (wPrimitiveCount - 1). The driver should calculate the vertex locations based on the current command as follows:
- When the command is D3DDP2OP_INDEXEDTRIANGLELIST, the indexes into the vertex buffer are relative to the vertex buffer offset specified by the dwVertexOffset member of the D3DHAL_DRAWPRIMITIVES2DATA structure.
- When the command is D3DDP2OP_INDEXEDTRIANGLELIST2, there is a D3DHAL_DP2STARTVERTEX structure that immediately follows the command in the command buffer. The indexes into the vertex buffer are relative to the vertex buffer offset specified by dwVertexOffset plus the base offset obtained from the wVStart member of the D3DHAL_DP2STARTVERTEX structure.
The following figure shows a portion of a sample command buffer containing a D3DDP2OP_INDEXEDTRIANGLELIST command and two D3DHAL_DP2INDEXEDTRIANGLELIST structures. The driver should draw two triangles with all edges enabled using the following six vertices from the vertex buffer: (v[3], v[4], v[5]), (v[0], v[1], v[2]).
Similarly, the following figure shows a portion of a sample command buffer containing a D3DDP2OP_INDEXEDTRIANGLELIST2 command, a D3DHAL_DP2STARTVERTEX offset, and two D3DHAL_DP2INDEXEDTRIANGLELIST structures. The driver should process six vertices from the vertex buffer, rendering two triangles defined by (v[5], v[6], v[7]), (v[2], v[3], v[4]).
Requirements
OS Versions: Windows CE .NET 4.0 and later.
Header: D3dhal.h.
See Also
D3dDrawPrimitives2 | D3DHAL_DP2COMMAND | D3DDP2OP_INDEXEDTRIANGLELIST | D3DHAL_DRAWPRIMITIVES2DATA | D3DHAL_DP2STARTVERTEX | D3DHAL_XXX Structures
Last updated on Tuesday, May 18, 2004
© 1992-2003 Microsoft Corporation. All rights reserved.