Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IDirect3DDevice9::DrawIndexedPrimitive method

Based on indexing, renders the specified geometric primitive into an array of vertices.

Syntax


HRESULT DrawIndexedPrimitive(
  [in]  D3DPRIMITIVETYPE Type,
  [in]  INT BaseVertexIndex,
  [in]  UINT MinIndex,
  [in]  UINT NumVertices,
  [in]  UINT StartIndex,
  [in]  UINT PrimitiveCount
);

Parameters

Type [in]

Type: D3DPRIMITIVETYPE

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]

Type: INT

Offset from the start of the vertex buffer to the first vertex. See Scenario 4.

MinIndex [in]

Type: UINT

Minimum vertex index for vertices used during this call. This is a zero based index relative to BaseVertexIndex.

NumVertices [in]

Type: UINT

Number of vertices used during this call. The first vertex is located at index: BaseVertexIndex + MinIndex.

StartIndex [in]

Type: UINT

Index of the first index to use when accesssing the vertex buffer. Beginning at StartIndex to index vertices from the vertex buffer.

PrimitiveCount [in]

Type: UINT

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

Type: HRESULT

If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be the following: 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.

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 legacy application to Direct3D 9, you must add a call to either IDirect3DDevice9::SetFVF to use the fixed function pipeline, or IDirect3DDevice9::SetVertexDeclaration to use a vertex shader before you make any Draw calls.

Requirements

Header

D3D9.h

Library

D3D9.lib

See also

IDirect3DDevice9
Rendering from Vertex and Index Buffers (Direct3D 9)
Index Buffers (Direct3D 9)
Vertex Buffers (Direct3D 9)
IDirect3DDevice9::DrawPrimitive

 

 

Community Additions

Show:
© 2014 Microsoft