ID3DXPatchMesh::CloneMesh method

Creates a new patch mesh with the specified vertex declaration.

Syntax

HRESULT CloneMesh(
  [in]                DWORD             Options,
  [in]          const D3DVERTEXELEMENT9 *pDecl,
  [out, retval]       LPD3DXPATCHMESH   *pMesh
);

Parameters

Options [in]

Type: DWORD

Combination of one or more D3DXMESH flags that specify creation options for the mesh.

pDecl [in]

Type: const D3DVERTEXELEMENT9*

Array of D3DVERTEXELEMENT9 elements that specify the vertex format for the vertices in the output mesh.

pMesh [out, retval]

Type: LPD3DXPATCHMESH*

Address of a pointer to an ID3DXPatchMesh interface that represents the cloned mesh.

Return value

Type: HRESULT

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

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

Requirement Value
Header
D3DX9Mesh.h
Library
D3dx9.lib

See also

ID3DXPatchMesh