Microsoft DirectX 8.1 (C++)

IDirect3DDevice8::DrawIndexedPrimitive

Renders the indexed geometric primitive into an array of vertices.

HRESULT DrawIndexedPrimitive(
  D3DPRIMITIVETYPE Type,
  UINT MinIndex,
  UINT NumVertices,
  UINT StartIndex,
  UINT PrimitiveCount
);

Parameters

Type
[in] Member of the D3DPRIMITIVETYPE enumerated type, describing the type of primitive to render. See Remarks.
MinIndex
[in] Minimum vertex index for vertices used during this call.
NumVertices
[in] The number of vertices indexed during this call, starting from BaseVertexIndex + StartIndex
StartIndex
[in] Location in the index array to start reading indices.
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 D3DCAPS8 structure.

Return Values

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value can be D3DERR_INVALIDCALL.

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, set during the IDirect3DDevice8::SetIndices call.

The minIndex and NumVertices parameters specify the range of vertex indices used for each 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.

DrawIndexedPrimitive fails if no index array is set.

The D3DPT_POINTLIST member of the D3DPRIMITIVETYPE enumerated type is not supported and should not be specified for Type.

When converting a fixed function legacy application to Microsoft® DirectX® 8, you must add a call to IDirect3DDevice8::SetVertexShader before you make any calls to DrawIndexedPrimitive. Supply SetVertexShader with the fixed function flag to tell the pipeline that the application is fixed function.

Requirements

  Header: Declared in D3d8.h.
  Import Library: Use D3d8.lib.

See Also

IDirect3DDevice8::DrawPrimitive, IDirect3DDevice8::SetStreamSource, Rendering Primitives