Skip to content

Latest commit

 

History

History
117 lines (72 loc) · 2.79 KB

d3dxoptimizevertices.md

File metadata and controls

117 lines (72 loc) · 2.79 KB
description ms.assetid title ms.topic ms.date topic_type api_name api_type api_location
Generates an optimized vertex remapping for a triangle list. This function is commonly used after applying the face remapping generated by D3DXOptimizeFaces.
a3b9cb68-204e-4e8f-a985-738d1cea1e29
D3DXOptimizeVertices function (D3DX9Mesh.h)
reference
05/31/2018
APIRef
kbSyntax
D3DXOptimizeVertices
LibDef
d3dx9.lib
d3dx9.dll

D3DXOptimizeVertices function

Generates an optimized vertex remapping for a triangle list. This function is commonly used after applying the face remapping generated by D3DXOptimizeFaces.

Syntax

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

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.

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 vertices), FALSE if indices are 16-bit (65535 or fewer vertices).

pVertexRemap [in, out]

Type: DWORD*

Pointer to a destination buffer that will contain the new index for each vertex. The value stored in pVertexRemap for a given element is the source vertex location in the new vertex ordering.

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

By default, a mesh uses 16 bit indices when it is created unless the application specifies otherwise. To check whether an existing mesh uses 16-bit or 32-bit indices, call ID3DXBaseMesh::GetOptions and check for the D3DXMESH_32BIT flag.

Requirements

Requirement Value
Header
D3DX9Mesh.h
Library
D3dx9.lib

See also

Mesh Functions