D3DXCreateMeshFromX frustration

Started by
0 comments, last by xissburg 18 years, 7 months ago
I'm having a big problem with D3DXCreateMeshFromX, I have been working with it for hours and still no progress. Here is some of the code: void Graphics::LoadMesh(char* path) { LPD3DXBUFFER materialBuffer; LPD3DXBUFFER adjacencyBuffer; DWORD numMaterials; LPD3DXMESH mesh; if(FAILED(D3DXLoadMeshFromX("sphere2.x", D3DXMESH_SYSTEMMEM, _device, &adjacencyBuffer, &materialBuffer, NULL, &numMaterials, &mesh))) { MessageBox(_hwnd, "D3DXLoadMeshFromX() - Failed", "LoadMesh()",MB_OK); return; } -------------------------------------------------------------- for some reason D3DXLoadMesh is failing and giving me the messagebox. I have sphere2.x in the debug folder and the parent folder to be sure. Also have tried using the path argument for the filename. I've looked at other working D3DXLoadMesh's and can't seem to find any differences, probably the most frustrating problem I've had yet. EDIT : I ran debug on it and found out the device was null..=\ For some reason that method wasn't getting the right class instance where the device was created. I made a global pointer to the right class instance and it seems to be working now..no errors anyway. [Edited by - durban on September 3, 2005 6:46:16 PM]
Advertisement
well, when I load a mesh through D3DXLoadMeshFromX() I set the 'ppAdjascency' parameter to NULL.I never had problems using this function...I don't think this is the problem...Its too strange it be the problem!!...Your code is Ok but....:S
.

This topic is closed to new replies.

Advertisement