Microsoft DirectX 8.0 (C++) |
Saves a mesh to a Microsoft® DirectX® (.x) file.
HRESULT D3DXSaveMeshToX( LPSTR pFilename, LPD3DXMESH pMesh, CONST DWORD* pAdjacency, CONST LPD3DXMATERIAL pMaterials, DWORD NumMaterials, DWORD Format );
If the function succeeds, the return value is D3D_OK.
If the function fails, the return value can be D3DERR_INVALIDCALL.
The default value for the file format is DXFILEFORMAT_BINARY. The file format values can be combined together in a logical OR to create compressed text or compressed binary files. If a file is specified as both binary (0) and text (1), it will be saved as a text file because the value will be indistinguishable from the text file format value (0 + 1 = 1). If you indicate that the file format should be text and compressed, the file will first be written out as text and then compressed. However, compressed text files are not as efficient as binary text files, so in most cases you will want to indicate binary and compressed. Setting a file to be compressed without specifying a format will result in a binary, compressed file.
Header: Declared in D3dx8mesh.h.
Import Library: Use D3dx8.lib.