Microsoft DirectX 8.1 (C++)

IDirect3DDevice8::SetIndices

Sets index data.

HRESULT SetIndices(
  IDirect3DIndexBuffer8* pIndexData
  UINT BaseVertexIndex
);

Parameters

pIndexData
[in] Pointer an IDirect3DIndexBuffer8 interface, representing the index data to be set.
BaseVertexIndex
[in] Base value for vertex indices. This value is added to all indices prior to referencing vertex data, defining a starting position in the vertex streams.

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 increments the reference count of the index buffer being assigned and decrements the reference count of the previously assigned index buffer. When the index buffer is no longer needed, set it to NULL. If you fail to do this, the index buffer is not released, resulting in a memory leak.

The SetIndices method sets the current index array to an index buffer. The single set of indices is used to index all streams.

The BaseVertexIndex parameter specifies the base value for indices. This base value is added to all indices prior to referencing into the vertex data streams, the result of which is to set a starting position in the vertex data streams. The base vertex index enables multiple indexed primitives to be packed into a single set of vertex data without requiring the indices to be recomputed based on where the corresponding primitive is placed in the vertex data.

Requirements

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

See Also

IDirect3DDevice8::GetIndices