Microsoft DirectX 8.0 (C++)

D3DXCleanMesh

Cleans a mesh, preparing it for simplification.

HRESULT D3DXCleanMesh(
  LPD3DXMESH pMeshIn,
  CONST DWORD* pAdjacency,
  LPD3DXMESH* ppMeshOut
);

Parameters

pMeshIn
[in] Pointer to an ID3DXMesh interface, representing the mesh to be cleaned.
pAdjacency
[in] Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh to be cleaned.
ppMeshOut
[out] An address of a pointer to an ID3DXMesh interface, representing the returned cleaned mesh. The same mesh is returned that was passed in if no cleaning was necessary.

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 values.

D3DERR_INVALIDCALL
E_OUTOFMEMORY

Remarks

This method cleans the mesh by adding another vertex where two fans of triangles share the same vertex.

Requirements

  Header: Declared in D3dx8mesh.h.
  Import Library: Use D3dx8.lib.