D3DXCreatePatchMesh
Microsoft DirectX 9.0 SDK Update (October 2004)

D3DXCreatePatchMesh Function


Creates a mesh from a control-patch mesh.

Syntax

HRESULT WINAPI 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 Value

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_INVALIDCALLThe method call is invalid. For example, a method's parameter may have an invalid value.
E_OUTOFMEMORYMicrosoft Direct3D could not allocate sufficient memory to complete the call.


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.

Function Information

Headerd3dx9mesh.h
Import libraryd3dx9.lib
Minimum operating systems Windows 98

See Also

D3DXPATCHINFO


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.