![]() |
![]() |
![]() |
Generates an optimized face remapping for a triangle list.
Syntax
HRESULT WINAPI 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.
- 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 vertices), FALSE if indices are 16-bit (65535 or fewer vertices).
- pFaceRemap
- [in, out] Pointer to a destination buffer that will contain the new index for each face. The value stored in pFaceRemap for a given element is the source face location in the new face ordering.
Return Value
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 The method call is invalid. For example, a method's parameter may have an invalid value. E_OUTOFMEMORY Microsoft Direct3D could not allocate sufficient memory to complete the call.
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.
Function Information
Header d3dx9mesh.h Import library d3dx9.lib Minimum operating systems Windows 98