Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with D3DXSaveMeshToX

Status
Not open for further replies.

dpkeller

Programmer
Nov 20, 2004
1
0
0
US
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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top