Share via


IDirect3DMobileDevice::DrawIndexedPrimitive (Windows CE 5.0)

Send Feedback

This method is used to draw primitives based on data read from an index buffer.

HRESULT DrawIndexedPrimitive(  D3DMPRIMITIVETYPE PrimitiveType,  INT BaseVertexIndex,  UINT minIndex,  UINT NumVertices,  UINT startIndex,  UINT primCount);

Parameters

  • PrimitiveType
    [in] Member of the D3DMPRIMITIVETYPE enumerated type, except for D3DMPT_POINTLIST, describing the type of primitive to render. For more information, see Remarks.
  • BaseVertexIndex
    [in] An INT value that when added to minIndex specifies the start of the valid range of vertex offsets that the command may access.
  • minIndex
    [in] A UINT value that when added to BaseVertexIndex specifies the start of the valid range of vertex offsets that the command may access.
  • NumVertices
    [in] A UINT value that specifies the end of the valid range of vertex offsets that the command may access.
  • startIndex
    [in] A UINT value that specifies the first position in the index buffer to begin reading indices from.
  • primCount
    [in] A UNIT value that specifies the number of primitives to draw. In combination with PrimitiveType, this parameter implicitly defines the number of index values required for the operation. If there are insufficient index values in the current index buffer to draw a primitive, the primitive is ignored and processing continues.

Return Values

Error Code Description
D3DMERR_DRIVERINVALIDCALL See Remarks.
D3DMERR_DRIVERINTERNALERROR There was no active vertex or index buffer when the method was called.

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 IDirect3DMobileDevice::SetIndices call.

Each time an index is read from the index buffer, the value is added to minIndex and baseVertexIndex to get the vertex offset to use. If that offset does not lie within the range specified then the drawing command is halted, a D3DMERR_DRIVERINVALIDCALL error returned, and the next command is processed.

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

Requirements

OS Versions: Windows CE 5.0 and later.
Header: D3dm.h.
Link Library: D3dm.lib, D3dmguid.lib.

See Also

IDirect3DMobileDevice | D3DMPRIMITIVETYPE | IDirect3DMobileDevice::SetIndices

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.