Advertisement Jump to content


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


Cannot recover lost device

This topic is 5395 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
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,

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, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!