I'm having trouble with the D3DXSaveMeshToX function. I am starting with the most basic thing which is to open a file, and then save it right away. I get an access violation when I run this. From the debugger it looks like the error is in the getString function. Here is the code
// Load the mesh from the specified file
hr = D3DXLoadMeshFromX( strMesh, D3DXMESH_SYSTEMMEM, m_pd3dDevice,
ppAdjacencyBuffer, &pD3DXMtrlBuffer, NULL,
&m_dwNumMaterials, &pMeshSysMem );
if( FAILED(hr) )
goto End;
_tcscpy( m_strMeshFilename, _T("C:\\dx90sdk\\Samples\\Media\\tiger2.x") );
hr = D3DXSaveMeshToX(
m_strMeshFilename,
pMeshSysMem,
(const unsigned long *)*ppAdjacencyBuffer,
(D3DXMATERIAL *)pD3DXMtrlBuffer,
NULL,
m_dwNumMaterials,
DXFILEFORMAT_BINARY
);
Can anyone help me with this?
// Load the mesh from the specified file
hr = D3DXLoadMeshFromX( strMesh, D3DXMESH_SYSTEMMEM, m_pd3dDevice,
ppAdjacencyBuffer, &pD3DXMtrlBuffer, NULL,
&m_dwNumMaterials, &pMeshSysMem );
if( FAILED(hr) )
goto End;
_tcscpy( m_strMeshFilename, _T("C:\\dx90sdk\\Samples\\Media\\tiger2.x") );
hr = D3DXSaveMeshToX(
m_strMeshFilename,
pMeshSysMem,
(const unsigned long *)*ppAdjacencyBuffer,
(D3DXMATERIAL *)pD3DXMtrlBuffer,
NULL,
m_dwNumMaterials,
DXFILEFORMAT_BINARY
);
Can anyone help me with this?