Jump to content
  • Advertisement
Sign in to follow this  
Replicon

SDL and handling lost devices

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

So SDL sits on top of DX (in windows anyway), and you can use video memory and all that fun stuff. My question is, does it abstract away the concept of lost devices, or is that something we still have to do by hand, like when coding with DirectX? By "lost device", I mean if you alt-tab out of your game, and start typing into MSN or whatever, you might lose your device. Also, you may end up mangling video memory. When coding with DX, you tend to write some function to reload all the textures and stuff that were in the video memory, since they might have been clobbered. Does SDL deal with these two different (but related) problems on some level?

Share this post


Link to post
Share on other sites
Advertisement
That's what I thought. I tried running something and alt-tabbing out of it, and running other games and a bunch of other things, and when I got back, everything was the way I left it. Sweet! Thanks for confirming.

Share this post


Link to post
Share on other sites
Warning: you can still lose your video memory, and SDL_BlitSurface will return -2. Check the docs. You may never see this yourself, but one of your users might.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kylotan
Warning: you can still lose your video memory, and SDL_BlitSurface will return -2. Check the docs. You may never see this yourself, but one of your users might.


You are right, the documentation does mention it. I'll have to be careful with my hardware surfaces :-). Thanks for pointing that out. The doc also says this happens under DirectX5. Is this because it doesn't happen for newer DX versions, or is it just an old doc? Either way, I bet it happens under Linux as well, so I better take care.

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!