D3DXOptimizeFaces function

Generates an optimized face remapping for a triangle list.

Syntax

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

Parameters

pIndices [in]

Type: LPCVOID

Pointer to triangle list indices to use for ordering vertices.

NumFaces [in]

Type: UINT

Number of faces in the triangle list. For 16-bit meshes, this is limited to 2^16 - 1 (65535) or fewer faces.

NumVertices [in]

Type: UINT

Number of vertices referenced by the triangle list.

Indices32Bit [in]

Type: BOOL

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]

Type: DWORD*

Pointer to the original mesh face that was split to generate the current face.

Return value

Type: HRESULT

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

Requirement Value
Header
D3DX9Mesh.h
Library
D3dx9.lib

See also

Mesh Functions