Platform SDK: DirectX

IDirect3DDevice7::DrawIndexedPrimitiveStrided

The IDirect3DDevice7::DrawIndexedPrimitiveStrided method renders a geometric primitive, based on indexing into an array of strided vertices. For more information, see Strided Vertex Format.

HRESULT DrawIndexedPrimitiveStrided(
  D3DPRIMITIVETYPE d3dptPrimitiveType,  
  DWORD  dwVertexTypeDesc,              
  LPD3DDRAWPRIMITIVESTRIDEDDATA lpVertexArray,  
  DWORD  dwVertexCount,                 
  LPWORD lpwIndices,                    
  DWORD  dwIndexCount,                  
  DWORD  dwFlags                        
);

Parameters

d3dptPrimitiveType
Type of primitive to be rendered by this command. This must be one of the members of the D3DPRIMITIVETYPE enumerated type.

The D3DPT_POINTLIST member of D3DPRIMITIVETYPE is not indexed.

dwVertexTypeDesc
A combination of flexible vertex format flags that describes the vertex format for this primitive.
lpVertexArray
Address of a D3DDRAWPRIMITIVESTRIDEDDATA structure that contains pointers and memory strides for the vertex components of this primitive, in the format specified by the flags in dwVertexTypeDesc.
dwVertexCount
Defines the number of vertices in the list.

This parameter is used differently from the dwVertexCount parameter in the IDirect3DDevice7::DrawPrimitive method. In that method, the dwVertexCount parameter gives the number of vertices to draw, but here it gives the total number of vertices in the array pointed to by the lpVertexArray parameter. When you call IDirect3DDevice7::DrawIndexedPrimitiveStrided, you specify the number of vertices to draw in the dwIndexCount parameter.

lpwIndices
Pointer to a list of WORDs that are to be used to index into the specified vertex list when creating the geometry to render.
dwIndexCount
Specifies the number of indices provided for creating the geometry. The maximum number of indices allowed is D3DMAXNUMVERTICES (0xFFFF).
dwFlags
Zero to render the primitive without waiting, or the following flag:
D3DDP_WAIT
Causes the method to wait until the polygons have been rendered before it returns, instead of returning as soon as the polygons have been sent to the card. (On scene-capture cards, the method returns as soon as the card responds.) This flag is typically used for debugging. Applications should not attempt to use this flag to ensure that a scene is up to date before continuing.

Return Values

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value can be one of the following values:

D3DERR_INVALIDRAMPTEXTURE
D3DERR_INVALIDPRIMITIVETYPE
D3DERR_INVALIDVERTEXTYPE
DDERR_INVALIDPARAMS
DDERR_WASSTILLDRAWING

Remarks

Be sure that the vertices being rendered match the vertex format that you specify. For performance reasons, Direct3D does not attempt to verify that vertex size and stride match the provided flexible vertex format. If a mismatch occurs, a memory fault is likely to result.

This method should not be used when rendering from a vertex buffer, use a vertex buffer method instead.

This method, unlike its predecessor in previous interfaces, does not accept the D3DDP_DONOTCLIP, D3DDP_DONOTLIGHT, and D3DDP_DONOTUPDATEEXTENTS flags in the dwFlags parameter. The functionality offered by these flags is now available through the D3DRENDERSTATE_CLIPPING, D3DRENDERSTATE_LIGHTING, and D3DRENDERSTATE_EXTENTS render states.

This method does not support transformed vertices. Therefore, if you include the D3DFVF_XYZRHW vertex format descriptor in the dwVertexTypeDesc parameter, the method fails, returning D3DERR_INVALIDVERTEXTYPE.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Version: Requires DirectX 7.0.
  Header: Declared in d3d.h.

See Also

IDirect3DDevice7::DrawPrimitive, IDirect3DDevice7::DrawPrimitiveStrided, IDirect3DDevice7::DrawPrimitiveVB, IDirect3DDevice7::DrawIndexedPrimitive, IDirect3DDevice7::DrawIndexedPrimitiveVB, Strided Vertex Format