ID3DXPatchMesh::CloneMesh

Creates a new patch mesh with the specified vertex declaration.

HRESULT CloneMesh(
  DWORD Options,
  CONST D3DVERTEXELEMENT9 * pDecl,
  LPD3DXPATCHMESH * pMesh
);

Parameters

Options
[in] Combination of one or more D3DXMESH flags that specify creation options for the mesh.
pDecl
[in] Array of D3DVERTEXELEMENT9 elements that specify the vertex format for the vertices in the output mesh.
pMesh
[out, retval] Address of a pointer to an ID3DXPatchMesh interface that represents the cloned mesh.

Return Values

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

Remarks

ID3DXPatchMesh::CloneMesh converts the vertex buffer to the new vertex declaration. Entries in the vertex declaration that are new to the original mesh are set to 0. If the current mesh has adjacency, the new mesh will also have adjacency.

Requirements

Header: Declared in D3dx9mesh.h.