D3DXCreatePatchMesh function

Creates a mesh from a control-patch mesh.

Syntax

HRESULT D3DXCreatePatchMesh(
  _In_  const D3DXPATCHINFO     *pInfo,
  _In_        DWORD             dwNumPatches,
  _In_        DWORD             dwNumVertices,
  _In_        DWORD             dwOptions,
  _In_  const D3DVERTEXELEMENT9 *pDecl,
  _In_        LPDIRECT3DDEVICE9 pD3DDevice,
  _Out_       LPD3DXPATCHMESH   *pPatchMesh
);

Parameters

pInfo [in]

Type: const D3DXPATCHINFO*

Patch information structure. For more information, see D3DXPATCHINFO.

dwNumPatches [in]

Type: DWORD

Number of patches.

dwNumVertices [in]

Type: DWORD

Number of control vertices in the patch.

dwOptions [in]

Type: DWORD

Unused. Reserved for later use.

pDecl [in]

Type: const D3DVERTEXELEMENT9*

Array of D3DVERTEXELEMENT9 elements, describing the vertex format for the returned mesh.

pD3DDevice [in]

Type: LPDIRECT3DDEVICE9

Pointer the device that creates the patch mesh. See IDirect3DDevice9.

pPatchMesh [out]

Type: LPD3DXPATCHMESH*

Pointer to the ID3DXPatchMesh object that is created.

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

This method takes an input patch mesh and converts it to a tessellated mesh. Patch meshes use 16-bit index buffers. Therefore, indices to LockIndexBuffer are 16 bits.

Requirements

Requirement Value
Header
D3DX9Mesh.h
Library
D3dx9.lib

See also

Mesh Functions

D3DXPATCHINFO