?/TD>
Microsoft DirectX 9.0

IDirect3DDevice9::DrawPrimitiveUP Method


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

Syntax

HRESULT DrawPrimitiveUP(      

    D3DPRIMITIVETYPE PrimitiveType,     UINT PrimitiveCount,     const void *pVertexStreamZeroData,     UINT VertexStreamZeroStride );

Parameters

PrimitiveType
[in] Member of the D3DPRIMITIVETYPE enumerated type, describing the type of primitive to render.
PrimitiveCount
[in] Number of primitives to render. The maximum number of primitives allowed is determined by checking the MaxPrimitiveCount member of the D3DCAPS9 structure.
pVertexStreamZeroData
[in] User memory pointer to vertex data to use for vertex stream 0.
VertexStreamZeroStride
[in] Stride between data for each vertex, in bytes.

Return Value

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value can be

D3DERR_INVALIDCALLThe method call is invalid. For example, a method's parameter may have an invalid value.


Remarks

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

Following any IDirect3DDevice9::DrawPrimitiveUP call, the stream 0 settings, referenced by IDirect3DDevice9::GetStreamSource, are set to NULL.

The vertex data passed to IDirect3DDevice9::DrawPrimitiveUP does not need to persist after the call. Microsoft?Direct3D?completes its access to that data prior to returning from the call.

When converting a fixed function legacy application to Microsoft DirectX?9.0, you must add a call to IDirect3DDevice9::SetFVF before you make any Draw calls.

See Also

IDirect3DDevice9::DrawIndexedPrimitiveUP, IDirect3DDevice9::SetStreamSource, Rendering Primitives


© 2002 Microsoft Corporation. All rights reserved.