Archived

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

Detecting surface lost? (DirectDraw)

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