IDirect3DDevice3::DrawIndexedPrimitiveVB

The IDirect3DDevice3::DrawIndexedPrimitiveVB method renders a geometric primitive based on indexing into an array of vertices within a vertex buffer.

HRESULT DrawIndexedPrimitiveVB(
  D3DPRIMITIVETYPE d3dptPrimitiveType,
  LPDIRECT3DVERTEXBUFFER lpd3dVertexBuffer,
  LPWORD lpwIndices,
  DWORD  dwIndexCount,
  DWORD  dwFlags
);
 

Parameters

d3dptPrimitiveType
Type of primitive to be rendered by this command. This must be one of the members of the D3DPRIMITIVETYPE enumerated type.

Note that the D3DPT_POINTLIST member of D3DPRIMITIVETYPE is not indexed.

lpd3dVertexBuffer
Address of the IDirect3DVertexBuffer interface for the vertex buffer that contains the array of vertices. Vertices can be transformed or untransformed, optimized or unoptimized.
lpwIndices
Address of an array of WORDs that will be used to index into the vertices in the vertex buffer.
dwIndexCount
The number of indices in the array at lpwIndices. The maximum number of indices allowed is 65,535 (0xFFFF).
dwFlags
One or more of the following flags defining how the primitive is drawn:
D3DDP_DONOTCLIP
The application has already done the required clipping, so the system should not necessarily clip the primitives. (This flag is a hint; the system may clip the primitive even when this flag is specified, under some circumstances.)
D3DDP_DONOTLIGHT
Disables the Direct3D lighting engine. The system uses the diffuse and specular components at each vertex for shading when it rasterizes the set of primitives. If a diffuse or specular component is not specified, the system uses the default color for the missing component (0xFFFFFFFF for diffuse and 0x00000000 for specular).
D3DDP_DONOTUPDATEEXTENTS
Disables the updating of the screen rectangle affected by this rendering call. Using this flag can potentially help performance, but the extents returned by IDirect3DDevice3::GetClipStatus will not have been updated to account for the data rendered by this call.
D3DDP_WAIT
Causes the method to wait until the polygons have been rendered before it returns, instead of returning as soon as the polygons have been sent to the card. (On scene-capture cards, the method returns as soon as the card responds.) This flag is typically used for debugging. Applications should not attempt to use this flag to ensure that a scene is up-to-date before continuing.

Return Values

If the method succeeds, the return value is DD_OK.

If the method fails, the return value may be one of the following values:

D3DERR_INVALIDPRIMITIVETYPE
D3DERR_INVALIDVERTEXTYPE
D3DERR_VERTEXBUFFERLOCKED
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DDERR_WASSTILLDRAWING

Remarks

Software devices—MMX and RGB devices—cannot render from a video memory (local or non-local) vertex buffer. To render a vertex buffer using a software device, the vertex buffer must exist in system memory. Hardware devices can render from system memory or video memory vertex buffers.

You cannot render from a locked vertex buffer; calls to the IDirect3DDevice3::DrawIndexedPrimitiveVB or IDirect3DDevice3::DrawPrimitiveVB method using a locked buffer will fail, returning D3DERR_VERTEXBUFFERLOCKED.

This method was introduced with the IDirect3DDevice3 interface.

QuickInfo

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in d3d.h.
  Import Library: Use ddraw.lib.

See Also

IDirect3DDevice3::DrawPrimitive, IDirect3DDevice3::DrawPrimitiveStrided, IDirect3DDevice3::DrawPrimitiveVB, IDirect3DDevice3::DrawIndexedPrimitive, IDirect3DDevice3::DrawIndexedPrimitiveStrided