D3DHAL_DP2TRIANGLESTRIP structure

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).

The following figure shows a portion of a sample command buffer containing a D3DDP2OP_TRIANGLESTRIP command and one D3DHAL_DP2TRIANGLESTRIP structure. The driver should process five vertices from the vertex buffer, rendering a strip of three triangles defined by (v[0], v[1], v[2]), (v[1], v[3], v[2]), (v[2], v[3], v[4]).

Figure showing a command buffer with a D3DDP2OP_TRIANGLESTRIP command and one D3DHAL_DP2TRIANGLESTRIP structure

Requirements

Header

D3dhal.h (include D3dhal.h)

See also

D3DDP2OP_TRIANGLESTRIP
D3dDrawPrimitives2
D3DHAL_DP2COMMAND

 

 

Send comments about this topic to Microsoft

Show: