• Advertisement
Sign in to follow this  

D3DXCreateMeshFromX frustration

This topic is 4552 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement