![]() |
![]() |
![]() |
Creates a save object that will be used to save data to a .x file.
Syntax
HRESULT CreateSaveObject(
LPCVOID pData, D3DXF_FILESAVEOPTIONS flags, D3DXF_FILEFORMAT dwFileFormat, ID3DXFileSaveObject **ppSaveObj );
Parameters
- pData
- [in] Pointer to the name of the file to use for saving data.
- flags
- [in] Value that specifies the name of the file to which data is to be saved. This value can be one of the D3DXF_FILESAVEOPTIONS flags.
- dwFileFormat
- [in] Indicates the format to use when saving the .x file. This value can be one of the D3DXF_FILEFORMAT flags. For more information, see Remarks.
- ppSaveObj
- [out] Address of a pointer to an ID3DXFileSaveObject interface, representing the created save object.
Return Value
If the method succeeds, the return value is S_OK.
If the method fails, the return value can be one of the following:
D3DXFERR_BADVALUE A variable is outside its expected range; typically returned when an object pointer is invalid. D3DXFERR_PARSEERROR Data stream could not be parsed.
Remarks
After using this method, use methods of the ID3DXFileSaveObject interface to create data objects and to save templates or data.
For the saved file format dwFileFormat, one of the binary, legacy binary, or text flags in D3DXF_FILEFORMAT must be specified. The file can be compressed by using the optional D3DXF_FILEFORMAT_COMPRESSED flag.
The file format values can be combined in a logical OR to create compressed text or compressed binary files. If you indicate that the file format should be text and compressed, the file will be written out first as text and then compressed. However, compressed text files are not as efficient as binary text files; in most cases, therefore, you will want to indicate binary and compressed.
See Also
ID3DXFileSaveObject