Microsoft DirectX 9.0 SDK Update (October 2004)

Device.DrawUserPrimitives Method

Language:

Note: This documentation is preliminary and is subject to change.

Renders data specified by a user memory pointer as a sequence of geometric primitives of the specified type.

Definition

Visual Basic .NET Public Sub DrawUserPrimitives( _
    ByVal primitiveType As PrimitiveType, _
    ByVal primitiveCount As Integer, _
    ByVal vertexStreamZeroData As Object _
)
C# public void DrawUserPrimitives(
    PrimitiveType primitiveType,
    int primitiveCount,
    object vertexStreamZeroData
);
Managed C++ public: void DrawUserPrimitives(
    PrimitiveType primitiveType,
    int primitiveCount,
    Object *vertexStreamZeroData
);
JScript .NET public function DrawUserPrimitives(
    primitiveType : PrimitiveType,
    primitiveCount : int,
    vertexStreamZeroData : Object
);

Parameters

primitiveType Microsoft.DirectX.Direct3D.PrimitiveType. Member of the PrimitiveType enumerated type that describes the type of primitive to render.
primitiveCount System.Int32. Number of primitives to render. To determine the maximum number of primitives allowed, check the Caps.MaxPrimitiveCount member.
vertexStreamZeroData System.Object. User memory vertex data to use for vertex stream 0.

Remarks

This method is intended for use in applications that are unable to store their vertex data in vertex buffers. It supports only a single vertex stream, and uses the provided vertex data pointer and stride for vertex stream 0. It is invalid for the declaration of the current vertex shader to refer to vertex streams other than stream 0.

Following any Device.DrawUserPrimitives call, the stream 0 settings referenced by Device.GetStreamSource are set to null.

The vertex data passed to Device.DrawUserPrimitives does not need to persist after the call. Microsoft® Direct3D® completes its access to that data prior to returning from the call.

Exceptions
InvalidCallException The method call is invalid. For example, a method's parameter might contain an invalid value.


© 2004 Microsoft Corporation. All rights reserved. Terms of use.

Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center