D3DXLoadPatchMeshFromXof function

Loads a patch mesh from an ID3DXFileData object.

Syntax


HRESULT D3DXLoadPatchMeshFromXof(
  _In_  LPD3DXFILEDATA    pxofMesh,
  _In_  DWORD             Options,
  _In_  LPDIRECT3DDEVICE9 pD3DDevice,
  _Out_ LPD3DXBUFFER      *ppMaterials,
  _Out_ LPD3DXBUFFER      *ppEffectInstances,
  _Out_ PDWORD            pNumMaterials,
  _Out_ LPD3DXPATCHMESH   *ppMesh
);

Parameters

pxofMesh [in]

Type: LPD3DXFILEDATA

Pointer to an ID3DXFileData interface, representing the file data object to load.

Options [in]

Type: DWORD

Combination of one or more D3DXMESH flags, specifying creation options for the mesh.

pD3DDevice [in]

Type: LPDIRECT3DDEVICE9

Pointer to the device that the mesh is created from.

ppMaterials [out]

Type: LPD3DXBUFFER*

Array of materials contained in the mesh. Each material is indexed by an ID3DXBuffer interface.

ppEffectInstances [out]

Type: LPD3DXBUFFER*

Pointer to a buffer containing an array of effect instances, one per attribute group in the returned mesh. An effect instance is a particular instance of state information used to initialize an effect. See D3DXEFFECTINSTANCE. For more information about accessing the buffer, see ID3DXBuffer.

pNumMaterials [out]

Type: PDWORD

Pointer that contains the number of materials in the mesh.

ppMesh [out]

Type: LPD3DXPATCHMESH*

Address of a pointer to an ID3DXPatchMesh interface, representing the loaded mesh.

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, D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

Remarks

For mesh files that do not contain effect instance information, default effect instances will be generated from the material information in the .x file. A default effect instance will have default values that correspond to the members of the D3DMATERIAL9 structure.

The default texture name is also filled in, but is handled differently. The name will be Texture0@Name, which corresponds to an effect variable by the name of "Texture0" with an annotation called "Name." This will contain the string file name for the texture.

Requirements

Header

D3DX9Mesh.h

Library

D3dx9.lib

See also

Mesh Functions
D3DXEFFECTDEFAULT
D3DXEFFECTINSTANCE

 

 

Show: