Jump to content
  • Advertisement
Sign in to follow this  
InsaneBoarder234

D3D Lost Device - Never Receiving D3DERR_DEVICENOTRESET

This topic is 4813 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 working on a game and this being my first D3D project I didn't work on handling lost devices from the start but thought I better get it done before I get too much code done and get lost implementing it. From what I understand I have the correct process but it's not working so I must of missed something somewhere. Heres what I'm doing:
1) D3DERR_DEVICELOST returned from TestCooperativeLevel()
2) Call the following functions on my D3D related objects:
   LPD3DXFONT->OnLostDevice()
   LPD3DXSPRITE->OnLostDevice()
   LPDIRECT3DTEXTURE9->Release()
3) Wait for D3DERR_DEVICENOTRESET
4) Call the following functions on my D3D related objects:
   LPDIRECT3DDEVICE9->Reset()
   LPD3DXFONT->OnResetDevice();
   LPD3DXSPRITE->OnResetDevice();
5) Load back LPDIRECT3DTEXTURE9 objects.
When I run my program I have text displayed on screen along with an animated sprite. When I alt + tab away from the window and then click back on the window I simply get a black screen. Anyone know what I'm doing wrong? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Aha! Fixed it, thanks :)

You were right, I had a look over my main loop and realised I had TestCooperativeLevel() inside an if statement that fails whenever the device is lost.

Thats what I get for not implementing lost device handling from the start :)

Thanks again for the help.

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!