Jump to content
  • Advertisement

Archived

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

MindWipe

Detecting surface lost? (DirectDraw)

This topic is 6012 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 know you can do it by blitting and checking the returned value. But is there any other way to do it? Because this way I could check it each frame and restore if needed and not need to check every blit(meaning I have to implant a checking feature in atlast one function in all render functions) Is it at all possible? /MindWipe "If it doesn''t fit, force it; if it breaks, it needed replacement anyway."

Share this post


Link to post
Share on other sites
Advertisement
Each surface has a function called IsLost(). This will tell you if the memory associated with it is lost. You can use that instead of blitting and checking.

Share this post


Link to post
Share on other sites
Okey! Thanks, I''ll use the IsLost() function

/MindWipe

"If it doesn''t fit, force it; if it breaks, it needed replacement anyway."

Share this post


Link to post
Share on other sites
TestCooperativeLevel(), a member of the main DirectDraw interface will return DDERR_NOEXCLUSIVEMODE if it has been lost

In every game loop, check this function. If youve lost focus, jsut keep skipping over the body of the loop untill you get it back, then reload everything

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!