Jump to content
  • Advertisement
Sign in to follow this  
NovaCaine

Problems With D3DXLoadMeshFromX and Resetting Device

This topic is 4811 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

Hey all, I'm having a problem loading my meshes back in after relese when I reset the device( swapping between fullscreen and window ) i get an error D3DERR_INVALIDCALL on the line:
hr = D3DXLoadMeshFromX( "Tiger.x", D3DXMESH_SYSTEMMEM, p_pD3DDevice, NULL, &pD3DXMtrlBuffer, NULL, &m_dwNumMaterials, &m_pMesh );
and I'm resetting my device like this
m_D3DDevice->Reset( &m_Present_Parameters );
Am i doing something wrong? i dont understand how my app can create the device fine and load the models, but even if i reset the device without changing any of the present parameters i still get the same D3DERR on trying to reload the mesh. Am i not meant to be reloading the mesh on reset? any help or links would be great Thx in advance.

Share this post


Link to post
Share on other sites
Advertisement
Have you tried using the debug D3D runtimes, and putting the debug output level up to full? That should provide you with some more useful debug output. And are you sure that your D3DDevice pointer is valid when you try to load your mesh?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Do you call Release on the ID3DXMesh (m_pMesh)?

Don't know if you have ever seen this.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/technicalarticles/resourcemanagement.asp

Hope it helps

Share this post


Link to post
Share on other sites
Yes i am releasing the mesh, it just this is the first time i have tried writing a D3D app from scratch, trying to get my head around the whole lost devices bit.

I know i need to release the mesh and anything that uses a vertex or index buffer, im just unsure on the order in which to do these.

so my question is now

Do i need to release the buffers before resetting the D3D Device?

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!