| Microsoft DirectX 8.1 (Visual Basic) |
Loads a mesh from a Microsoft® DirectX® X file.
object.LoadMeshFromX( _
FileName As String, _
Options As Long, _
Device As Direct3DDevice8, _
RetAdjacency As D3DXBuffer, _
RetMaterials As D3DXBuffer, _
RetMaterialCount As Long) As D3DXMesh
D3DXMesh object representing the loaded mesh.
If the method fails, an error is raised and Err.Number can be set to one of the following values.
| D3DERR_INVALIDCALL |
| E_OUTOFMEMORY |
For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.
The following code fragment shows how to call LoadMeshFromX.
Dim g_device As Direct3DDevice8 Dim g_d3dx As D3DX8 Set g_d3dx = New D3DX8 Dim mesh As D3DXMesh Dim matBuf As D3DXBuffer ' The following assumes that FileName, g_device, matBuf, and matCount have been set to valid values. Set mesh = g_d3dx.LoadMeshFromX(FileName, D3DXMESH_MANAGED, g_device, Nothing, matBuf, matCount)
When LoadMeshFromX returns, matBuf and matCount have been set to valid values.
Note All the meshes in the file are collapsed into one output mesh. If the file contains a frame hierarchy, all the transformations are applied to the mesh.