D3DXCreatePatchMesh

Creates a mesh from a control-patch mesh.

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

Parameters

pInfo
[in] Patch information structure. For more information, see D3DXPATCHINFO.
dwNumPatches
[in] Number of patches.
dwNumVertices
[in] Number of control vertices in the patch.
dwOptions
[in] Unused. Reserved for later use.
pDecl
[in] Array of D3DVERTEXELEMENT9 elements, describing the vertex format for the returned mesh.
pD3DDevice
[in] Pointer the device that creates the patch mesh. See IDirect3DDevice9.
pPatchMesh
[out] Pointer to the ID3DXPatchMesh object that is created.

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: 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 ID3DXPatchMesh::LockIndexBuffer are 16 bits.

Requirements

Header: Declared in D3dx9mesh.h.

See Also

D3DXPATCHINFO