D3DXSaveMeshHierarchyToFile

Creates a .x file and saves the mesh hierarchy and corresponding animations in it.

HRESULT D3DXSaveMeshHierarchyToFile(
  LPCSTR pFilename,
  DWORD XFormat,
  CONST D3DXFRAME * pFrameRoot,
  LPD3DXANIMATIONCONTROLLER pAnimController,
  LPD3DXSAVEUSERDATA pUserDataSaver
);

Parameters

pFilename
[in] Pointer to a string that specifies the name of the .x file identifying the saved mesh. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.
XFormat
[in] Format of the .x file (text or binary, compressed or not). See D3DXF_FILEFORMAT. D3DXF_FILEFORMAT_COMPRESSED can be combined (using a logical OR) with either the D3DXF_FILEFORMAT_BINARY or D3DXF_FILEFORMAT_TEXT flags to reduce the output file size.
pFrameRoot
[in] Root node of the hierarchy to be saved. See D3DXFRAME.
pAnimController
[in] Animation controller that has animation sets to be stored. See ID3DXAnimationController.
pUserDataSaver
[in] Application-provided interface that allows saving of user data. See ID3DXSaveUserData.

Return Values

If the function succeeds, the return value is D3D_OK. If the function fails, the return value can be:

D3DERR_INVALIDCALL

Remarks

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to D3DXSaveMeshHierarchyToFileW. Otherwise, the function call resolves to D3DXSaveMeshHierarchyToFileA.

This function does not save compressed animation sets.

Requirements

Header: Declared in D3dx9mesh.h.

See Also

X File Reference