|Microsoft DirectX 9.0|
Renders the specified geometric primitive with data specified by a user memory pointer.
D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertexIndices, UINT PrimitiveCount, const void *pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride );
- [in] Member of the D3DPRIMITIVETYPE enumerated type, describing the type of primitive to render.
- [in] Minimum vertex index, relative to zero (the start of pVertexStreamZeroData), for vertices used during this call.
- [in] Number of vertices used during this call, starting from MinVertexIndex.
- [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 D3DCAPS9 structure.
- [in] User memory pointer to the index data.
- [in] Member of the D3DFORMAT enumerated type, describing the format of the index data. The valid settings are the following:
- Indices are 16 bits each.
- Indices are 32 bits each.
- [in] User memory pointer to vertex data to use for vertex stream 0.
- [in] Stride between data for each vertex, in bytes.
If the method succeeds, the return value is D3D_OK.
If the method fails, the return value can be
D3DERR_INVALIDCALL The method call is invalid. For example, a method's parameter may have an invalid value.
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, which must be declared as stream 0.
Following any IDirect3DDevice9::DrawIndexedPrimitiveUP call, the stream 0 settings, referenced by IDirect3DDevice9::GetStreamSource, are set to NULL. Also, the index buffer setting for IDirect3DDevice9::SetIndices is set to NULL.
The vertex data passed to IDirect3DDevice9::DrawIndexedPrimitiveUP 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.