I try to read a mesh from a .x file. The following code crashes, and I dont know why. Can anyone give me a hint?
pDXData->GetData(NULL, &dwSize, (PVOID*)&xbuffer);
LPD3DXBUFFER m_pbufMaterials, m_pbufAdjacency, m_pbufEffectInstances;
D3DXLoadMeshFromXof( xbuffer, D3DXMESH_MANAGED, g_pD3DDevice, &m_pbufAdjacency, &m_pbufMaterials, &m_pbufEffectInstances, &m_dwNumMaterials, &m_pMesh );
Just before this code I have successfully read other data (vectors). When I place the mesh in a separate file and load it with D3DXLoadMeshFromX, it works.