?/TD>
Microsoft DirectX 9.0

D3DXSaveMeshHierarchyToFile Function


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

Syntax

HRESULT D3DXSaveMeshHierarchyToFile(      

    LPCTSTR pFilename,     DWORD XFormat,     LPD3DXFRAME pFrameRoot,     LPD3DXANIMATIONCONTROLLER pAnimController,     LPD3DXSAVEUSERDATA pUserDataSaver );

Parameters

pFilename
[in] Pointer to a string that specifies the name of the .x file identifying the saved mesh. See Remarks.
XFormat
[in] Format of the .x file (text or binary, compressed or not, etc.). See Remarks.
pFrameRoot
[in] Root node of the hierarchy to be saved. See D3DXFRAME.
pAnimController
[in] Animation controller whose animation sets are to be stored. See ID3DXAnimationController.
pUserDataSaver
[in] Application-provided interface that allows saving of user data. See ID3DXSaveUserData.

Return Value

If the function succeeds, the return value is D3D_OK.

If the function fails, the return value can be

D3DERR_INVALIDCALLThe method call is invalid. For example, a method's parameter may have an invalid value.


Remarks

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to D3DXSaveMeshHeirarchyToFileW. Otherwise, the function call resolves to D3DXSaveMeshHeirarchyToFileA because ANSI strings are being used.

For more information about .x files, see X Files.

The default value for the file format is DXFILEFORMAT_BINARY. DXFILEFORMAT_COMPRESSED can be combined (using a logical OR) with either the text or binary flag to reduce the file size. If a file is specified with both binary (DXFILEFORMAT_BINARY) and text (DXFILEFORMAT_TEXT) flags, it will be saved as a text file.

Function Information

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


© 2002 Microsoft Corporation. All rights reserved.