D3DXOptimizeFaces

Generates an optimized face remapping for a triangle list.

HRESULT D3DXOptimizeFaces(
  LPCVOID pIndices,
  UINT NumFaces,
  UINT NumVertices,
  BOOL Indices32Bit,
  DWORD * pFaceRemap
);

Parameters

pIndices
[in] Pointer to triangle list indices to use for ordering vertices.
NumFaces
[in] Number of faces in the triangle list. For 16-bit meshes, this is limited to 2^16 - 1 (65535) or fewer faces.
NumVertices
[in] Number of vertices referenced by the triangle list.
Indices32Bit
[in] Flag indicating index type: TRUE if indices are 32-bit (more than 65535 indices), FALSE if indices are 16-bit (65535 or fewer indices).
pFaceRemap
[in, out] Pointer to the original mesh face that was split to generate the current face.

Return Values

If the function succeeds, the return value is D3D_OK. If the function fails, the return value can be one of the following: D3DERR_INVALIDCALL, E_OUTOFMEMORY.

Remarks

This function's optimization procedure is functionally equivalent to calling ID3DXMesh::Optimize with the D3DXMESHOPT_DEVICEINDEPENDENT flag, but this function makes more efficient use of vertex caches.

Requirements

Header: Declared in D3dx9mesh.h.