D3DHAL_DP2TRIANGLESTRIP structure (d3dhal.h)
One D3DHAL_DP2TRIANGLESTRIP structure is parsed from the command buffer by the D3dDrawPrimitives2 callback when the D3DHAL_DP2COMMAND structure's bCommand member is set to D3DDP2OP_TRIANGLESTRIP, and is used to render the specified connected triangle strip.
Syntax
typedef struct _D3DHAL_DP2TRIANGLESTRIP {
WORD wVStart;
} D3DHAL_DP2TRIANGLESTRIP, *LPD3DHAL_DP2TRIANGLESTRIP;
Members
wVStart
Specifies the index to the vertex buffer containing coordinate data for the initial vertex of the triangle strip.
Remarks
One D3DHAL_DP2TRIANGLESTRIP structure follows the D3DHAL_DP2COMMAND structure in the command buffer.
D3dDrawPrimitives2 should process a total of (wPrimitiveCount + 2) vertices from the vertex buffer. The value of wPrimitiveCount is specified in the D3DHAL_DP2COMMAND structure.
The triangle edges in a triangle strip are rendered in this order: (wV[0], wV[1], wV[2]), (wV[1], wV[3], wV[2]), (wV[2], wV[3], wV[4]), (wV[3], wV[5], wV[4]),...
For the last triangle in the triangle strip, however, the edges are rendered in different orders when wPrimitiveCountt is odd and when it is even.
- When wPrimitiveCount is an odd number, the last triangle's edges are rendered in this order: (wV[wPrimitiveCount - 1], wV[wPrimitiveCount], wV[wPrimitiveCount + 1]).
- When wPrimitiveCount is an even number, the last triangle's edges are rendered in this order: (wV[wPrimitiveCount- 1], wV[wPrimitiveCount + 1], wV[wPrimitiveCount).
Requirements
Requirement | Value |
---|---|
Header | d3dhal.h (include D3dhal.h) |
See also
D3DDP2OP_TRIANGLESTRIP