DirectX SDK

Direct3DDevice7.DrawIndexedPrimitiveVB

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

object.DrawIndexedPrimitiveVB( _ 
    d3Dpt As CONST_D3DPRIMITIVETYPE, _ 
    vertexBuffer As Direct3DVertexBuffer7, _ 
    StartVertex As Long, _ 
    NumVertices As Long, _ 
    indexArray() As Integer, _ 
    indexcount As Long, _ 
    flags As CONST_D3DDPFLAGS)

Parameters

object
Object expression that resolves to a Direct3DDevice7 object.
d3Dpt
Type of primitive to be rendered by this command. This must be one of the constants of the CONST_D3DPRIMITIVETYPE enumeration.

Note that the D3DPT_POINTLIST member of CONST_D3DPRIMITIVETYPE is not indexed.

vertexBuffer
A Direct3DVertexBuffer7 object for the vertex buffer that contains the array of vertices. Vertices can be transformed or untransformed, optimized or unoptimized.
StartVertex
Index of the first vertex in the vertex buffer that will be rendered.
NumVertices
Total number of vertices in the vertex buffer that will be rendered.
indexArray()
An array that will be used to index into the vertices in the vertex buffer. The values in the array must index vertices within the range [StartVertex, StartVertex + NumVertices – 1].
indexcount
The number of indices in the indexArray() array. The maximum number of indices allowed is 65535 (&HFFFF).
flags
One of the constants of the CONST_D3DDPFLAGS enumeration defining how the primitive is drawn.

Error Codes

If the method fails, an error is raised and Err.Number may be set to one of the following values:

D3DERR_INVALIDPRIMITIVETYPE
D3DERR_INVALIDVERTEXTYPE
D3DERR_VERTEXBUFFERLOCKED
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DDERR_WASSTILLDRAWING

For information on trapping errors, see the Visual Basic Error Trapping topic.

Remarks

Make sure that the vertices being rendered match the vertex format you specify. For performance reasons, Direct3D does not attempt to verify that vertex size and stride match the provided flexible vertex format. If a mismatch occurs, a memory fault is likely to result.

With the exception of the reference rasterizer, software 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 Direct3DDevice7.DrawIndexedPrimitiveVB or Direct3DDevice7.DrawPrimitiveVB method using a locked buffer will fail, returning D3DERR_VERTEXBUFFERLOCKED.

See Also

Direct3DDevice7.DrawPrimitive, Direct3DDevice7.DrawPrimitiveVB, Direct3DDevice7.DrawIndexedPrimitive