Microsoft DirectX 8.1 (Visual Basic)

Direct3DDevice8.DrawIndexedPrimitive

Renders the specified geometric primitive, based on indexing into an array of vertices.

object.DrawIndexedPrimitive( _ 
    PrimitiveType As CONST_D3DPRIMITIVETYPE, _ 
    MinIndex As Long, _ 
    NumIndices As Long, _ 
    StartIndex As Long, _ 
    PrimitiveCount As Long)

Parts

object
Object expression that resolves to a Direct3DDevice8 object.
PrimitiveType
Member of the CONST_D3DPRIMITIVETYPE enumeration, describing the type of primitive to render. See Remarks
MinIndex
Minimum vertex index for vertices used during this call.
NumIndices
The number of vertices indexed during this call starting from BaseVertexIndex + StartIndex.
StartIndex
Location in the index array to start reading indices.
PrimitiveCount
Number of primitives to render. The number of indices 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 D3DCAPS8 structure.

Error Codes

If the method fails, an error is raised and Err.Number can be set to D3DERR_INVALIDCALL.

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

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 Direct3DDevice8.SetIndices call.

The MinIndex and NumIndices parameters specify the range of vertex indices used for each 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.

DrawIndexedPrimitive fails if no index array is set.

The D3DPT_POINTLIST member of the CONST_D3DPRIMITIVETYPE enumeration is not supported and should not be specified for PrimitiveType.

See Also

Direct3DDevice8.DrawPrimitive, Direct3DDevice8.SetStreamSource, Rendering Primitives