Microsoft DirectX 8.0 (C++)

IDirect3DDevice8::DrawIndexedPrimitiveUP

Renders the specified geometric primitive with data specified by a user memory pointer.

HRESULT DrawIndexedPrimitiveUP(
  D3DPRIMITIVETYPE PrimitiveType,
  UINT MinIndex,
  UINT NumVertices,
  UINT PrimitiveCount,
  CONST void* pIndexData,
  D3DFORMAT IndexDataFormat,
  CONST void* pVertexStreamZeroData,
  UINT VertexStreamZeroStride
);

Parameters

PrimitiveType
[in] Member of the D3DPRIMITIVETYPE enumerated type, describing the type of primitive to render.
MinIndex
[in] Minimum vertex index, relative to zero (the start of pIndexData), for vertices used during this call.
NumVertices
[in] Number of vertices used during this call; starting from MinIndex.
PrimitiveCount
[in] 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.
pIndexData
[in] User memory pointer to the index data.
IndexDataFormat
[in] Member of the D3DFORMAT enumerated type, describing the format of the index data. The valid settings are the following:
D3DFMT_INDEX16
Indices are 16 bits each.
D3DFMT_INDEX32
Indices are 32 bits each.
pVertexStreamZeroData
[in] User memory pointer to vertex data to use for vertex stream zero.
VertexStreamZeroStride
[in] Stride between data for each vertex, in bytes.

Return Values

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 zero. It is invalid to have the declaration of the current vertex shader refer to vertex streams other than stream zero.

Following any DrawIndexedPrimitiveUP call, the stream zero settings, referenced by IDirect3DDevice8::GetStreamSource, are set to NULL. Also, the index buffer setting for IDirect3DDevice8::SetIndices is set to NULL.

Requirements

  Header: Declared in D3d8.h.
  Import Library: Use D3d8.lib.

See Also

IDirect3DDevice8::DrawPrimitiveUP, IDirect3DDevice8::SetStreamSource, Rendering Primitives