IDirect3DMobileDevice::DrawIndexedPrimitive
A version of this page is also available for
4/8/2010
This method is used to draw primitives based on data read from an index buffer.
Syntax
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 Value
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
Header | d3dm.h |
Library | D3dm.lib, D3dmguid.lib |
Windows Embedded CE | Windows CE 5.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |
See Also
Reference
IDirect3DMobileDevice
D3DMPRIMITIVETYPE
IDirect3DMobileDevice::SetIndices