Microsoft DirectX 8.1 (Visual Basic)

D3DX8.SaveMeshToX

Saves a mesh to a Microsoft® DirectX® X file.

object.SaveMeshToX( _ 
    FileName As String, _ 
    Mesh As D3DXMesh, _ 
    AdjacencyArray As Any, _ 
    MaterialArray As D3DXMATERIAL, _ 
    MaterialCount As Long, _ 
    xFormat As Long)

Parts

object
Object expression that resolves to a D3DX8 object.
FileName
String that specifies the name of the DirectX file identifying the saved mesh.
Mesh
D3DXMesh object representing the mesh to save to a DirectX file.
AdjacencyArray
First element of an array of three Long values per face that specify the three neighbors for each face in the mesh.
MaterialArray
First element of an array of D3DXMATERIAL types, containing material information to be saved in the DirectX file.
MaterialCount
Number of D3DXMATERIAL types in the MaterialArray array.
xFormat
A member of the CONST_DXFILEFORMATFLAGS enumeration indicating the format to use when saving the DirectX file.

Error Codes

If the method fails, an error is raised and Err.Number can be set to D3DERR_INVALIDCALL.

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Remarks

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 is saved as a text file because the value is indistinguishable from the text file format value (0 + 1 = 1). If you indicate that the file format should be text and compressed, the file is first written out as text and then compressed. However, compressed text files are not as efficient as binary text files, so in most cases you indicate binary and compressed. Setting a file to be compressed without specifying a format results in a binary, compressed file.