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 );
[in] Member of the D3DMPRIMITIVETYPE enumerated type, except for D3DMPT_POINTLIST, describing the type of primitive to render. For more information, see Remarks.
[in] An INT value that when added to minIndex specifies the start of the valid range of vertex offsets that the command may access.
[in] A UINT value that when added to BaseVertexIndex specifies the start of the valid range of vertex offsets that the command may access.
[in] A UINT value that specifies the end of the valid range of vertex offsets that the command may access.
[in] A UINT value that specifies the first position in the index buffer to begin reading indices from.
[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.
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.