D3DXLoadMeshHierarchyFromXInMemory function

Loads the first frame hierarchy from a .x file.

Syntax

HRESULT D3DXLoadMeshHierarchyFromXInMemory(
  _In_  LPCVOID                   pMemory,
  _In_  DWORD                     SizeOfMemory,
  _In_  DWORD                     MeshOptions,
  _In_  LPDIRECT3DDEVICE9         pDevice,
  _In_  LPD3DXALLOCATEHIERARCHY   pAlloc,
  _In_  LPD3DXLOADUSERDATA        pUserDataLoader,
  _Out_ LPD3DXFRAME               *ppFrameHeirarchy,
  _Out_ LPD3DXANIMATIONCONTROLLER *ppAnimController
);

Parameters

pMemory [in]

Type: LPCVOID

Pointer to a buffer that contains the mesh hierarchy.

SizeOfMemory [in]

Type: DWORD

Size of the pMemory buffer, in bytes.

MeshOptions [in]

Type: DWORD

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

pDevice [in]

Type: LPDIRECT3DDEVICE9

Pointer to an IDirect3DDevice9 interface, the device object associated with the mesh.

pAlloc [in]

Type: LPD3DXALLOCATEHIERARCHY

Pointer to an ID3DXAllocateHierarchy interface.

pUserDataLoader [in]

Type: LPD3DXLOADUSERDATA

Application provided interface that allows loading of user data. See ID3DXLoadUserData.

ppFrameHeirarchy [out]

Type: LPD3DXFRAME*

Returns a pointer to the loaded frame hierarchy. See D3DXFRAME.

ppAnimController [out]

Type: LPD3DXANIMATIONCONTROLLER*

Returns a pointer to the animation controller corresponding to animation in the .x file. This is created with default tracks and events. See ID3DXAnimationController.

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 values: D3DERR_INVALIDCALL, E_OUTOFMEMORY.

Remarks

All the meshes in the file will be collapsed into one output mesh. If the file contains a frame hierarchy, all the transformations will be applied to the mesh.

Requirements

Requirement Value
Header
D3dx9anim.h
Library
D3dx9.lib

See also

Animation Functions