?/TD>
Microsoft DirectX 9.0

IDirect3DDevice9::DrawIndexedPrimitive Method


Renders the specified geometric primitive, based on indexing into an array of vertices.

Syntax

HRESULT DrawIndexedPrimitive(      

    D3DPRIMITIVETYPE Type,     INT BaseVertexIndex,     UINT MinIndex,     UINT NumVertices,     UINT StartIndex,     UINT PrimitiveCount );

Parameters

Type
[in] Member of the D3DPRIMITIVETYPE enumerated type, describing the type of primitive to render. D3DPT_POINTLIST is not supported with this method. See Remarks.
BaseVertexIndex
[in] Offset from the start of the index buffer to the first vertex index.
MinIndex
[in] Minimum vertex index for vertices used during this call.
NumVertices
[in] Number of vertices used during this call, starting from BaseVertexIndex + MinIndex
StartIndex
[in] Location in the index array to start reading vertices.
PrimitiveCount
[in] Number of primitives to render. The number of vertices used is a function of the primitive count and the primitive type. The maximum number of primitives allowed is determined by checking the MaxPrimitiveCount member of the D3DCAPS9 structure.

Return Value

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value can be

D3DERR_INVALIDCALLThe method call is invalid. For example, a method's parameter may have an invalid value.


Remarks

This method draws indexed primitives from the current set of data input streams.

MinIndex and all the indices in the index stream are relative to the BaseVertexIndex.

The MinIndex and NumVertices parameters specify the range of vertex indices used for each IDirect3DDevice9::DrawIndexedPrimitive call. These are used to optimize vertex processing of indexed primitives by processing a sequential range of vertices prior to indexing into these vertices. It is invalid for any indices used during this call to reference any vertices outside of this range.

IDirect3DDevice9::DrawIndexedPrimitive fails if no index array is set.

The D3DPT_POINTLIST member of the D3DPRIMITIVETYPE enumerated type is not supported and is not a valid type for this method.

When converting a fixed function legacy application to Microsoft?DirectX?9.0, you must add a call to IDirect3DDevice9::SetFVF before you make any Draw calls.

See Also

IDirect3DDevice9::DrawPrimitive, IDirect3DDevice9::SetStreamSource, Rendering Primitives


© 2002 Microsoft Corporation. All rights reserved.