Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Uriel

Cannot recover lost device

This topic is 5209 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 have fullscreen app using directInput. I tried to handle DEVICELOST event, so i used this code in msg pump: if((D3DDev->TestCooperativeLevel())!= D3D_OK){ if(D3DDev->TestCooperativeLevel()==D3DERR_DEVICELOST){ DIH.UnAcquire(); //dinput Sleep(500); ReleaseSurfaces();//here i release all //surfaces using POOL memory }else if(D3DDev->TestCooperativeLevel()==D3DERR_DEVICENOTRESET){ lpD3DDevice->Reset(&pp); RecoverSurfaces(); } }else{ /* here i render , update logics and so on because if im here, the device is not lost*/ } The problem is, that it never enters if(D3DDev->TestCooperativeLevel()==D3DERR_DEVICENOTRESET) so the device cannot be reseted. My app remains minimalized and i can only close it. Any ideas what can be wrong?

Share this post


Link to post
Share on other sites
Advertisement
Ok, main problem was my stupidity after all, i placed whole code not in msg pump..
But now all is fine, but when i try to reset device, it does not return D3D_OK. What it returns i cannot say, but for sure its not one of codes mentioned in docs: D3DERR_DEVICELOST , D3DERR_DRIVERINTERNALERROR, D3DERR_INVALIDCALL,
D3DERR_OUTOFVIDEOMEMORY, E_OUTOFMEMORY.

I do release all vertex buffers and textures using D3DPOOL_DEFAULT memory before attempting to reset device. I have no idea what more should i release.. I use directSound, i have stencil shadows, i also have bumpmapped water made with two render target textures but i release them too. What else should i release?

Share this post


Link to post
Share on other sites

  • 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!