Microsoft DirectX 8.1 (Visual Basic)

Direct3DDevice8.DrawPrimitive

Renders nonindexed primitives from the current set of data input streams.

object.DrawPrimitive( _ 
    PrimitiveType As CONST_D3DPRIMITIVETYPE, _ 
    StartVertex 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.
StartVertex
Index of the first vertex to load. Beginning at StartVertex, the correct number of vertices will be read out of the vertex buffer.
PrimitiveCount
Number of primitives to render. The maximum number of primitives allowed is determined by checking the MaxPrimitiveCount member of the D3DCAPS8 structure. PrimitiveCount is the number of primitives as determined by the primitive type. If it is a line list, each primitive has two vertices. If it is a triangle list, each primitive has three vertices.

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

DrawPrimitive should not be called with a single triangle at a time.

See Also

Direct3DDevice8.DrawIndexedPrimitive, Direct3DDevice8.SetStreamSource, Rendering Primitives