IDirect3DDevice9::DrawPrimitiveUP method (d3d9.h)

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

Syntax

HRESULT DrawPrimitiveUP(
  [in] D3DPRIMITIVETYPE PrimitiveType,
  [in] UINT             PrimitiveCount,
  [in] const void       *pVertexStreamZeroData,
  [in] UINT             VertexStreamZeroStride
);

Parameters

[in] PrimitiveType

Type: D3DPRIMITIVETYPE

Member of the D3DPRIMITIVETYPE enumerated type, describing the type of primitive to render.

[in] PrimitiveCount

Type: UINT

Number of primitives to render. The maximum number of primitives allowed is determined by checking the MaxPrimitiveCount member of the D3DCAPS9 structure.

[in] pVertexStreamZeroData

Type: const void*

User memory pointer to the vertex data.

[in] VertexStreamZeroStride

Type: UINT

The number of bytes of data for each vertex. This value may not be 0.

Return value

Type: HRESULT

If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be: D3DERR_INVALIDCALL.

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. Direct3D completes its access to that data prior to returning from the call.

When converting a legacy application to Direct3D 9, you must add a call to either IDirect3DDevice9::SetFVF to use the fixed function pipeline, or IDirect3DDevice9::SetVertexDeclaration to use a vertex shader before you make any Draw calls.

Requirements

Requirement Value
Target Platform Windows
Header d3d9.h (include D3D9.h)
Library D3D9.lib

See also

IDirect3DDevice9

IDirect3DDevice9::DrawIndexedPrimitiveUP

Rendering from Vertex and Index Buffers (Direct3D 9)