Jump to content
  • Advertisement
Sign in to follow this  
Swatter555

Lost Device/Reset problem

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

Im a little stumped on a problem. Im thinking Ive got my lost/reset d3d code done pretty much correctly, but the d3d sprite doesnt seem to be working right. When I test the d3d cooperative level(after alt-tab), the device returns lost. I then to proceed to release my fonts, textures, and call the sprite object's lost device method. I then attempt to reset the d3d device. If that works I call the sprite's on reset method. I finish up with reloading the textures and fonts. I can get through all that without any errors, it looks like. The hResults I get look ok. The problem is that when I attempt to draw a sprite it crashes. The sprite draw method crashes before it even returns an HRESULT it looks like. Any ideas, things I left out?

Share this post


Link to post
Share on other sites
Advertisement
Do the debug runtimes splurt out anything useful?

Also, the ID3DXFont interface also has OnLost/OnReset methods. It's possible you'll need to call those instead of doing the Release+Recreate.

Hope this helps.

Share this post


Link to post
Share on other sites
Thanks for the font info, I changed that.

After the crash the debugger points to my sprite drawing method, with stuff about access violations. I doubt its anything having to do with textures, because I am releasing and reloading them successfully.

If its not the textures or the fonts, I dont know what it would be :(

Share this post


Link to post
Share on other sites
Have you enabled the Debug Runtimes? Here's a link from JollyJeffer's signature describing how to do it.

Once you enable them, it should spit out lots of debug info, including any failures that might be occuring, or other innappropriate behaviour. It would most likely provide you with some helpful information :).

Hope this helps.

Share this post


Link to post
Share on other sites
Ya, I got the debug runtime working with the D3D Helper. Unfortunately, I dont think it gave me more info than I had before.

Im making a 2d engine that simply uses the sprite object in D3D. I know the d3d device does reset, so all my resources were properly released. I call the lost/reset sprite methods. I am stumped. The only thing I can think of is that I have some mistake in the order things are being executed.

Share this post


Link to post
Share on other sites
I think I have located the problem, I had some old texture pointers hanging around. Its a darn shame such a simple problem hung me up for so long. On a positive note, I finally got motivated to use the d3d debugger.

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!