Archived

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

MindWipe

Detecting surface lost? (DirectDraw)

Recommended Posts

MindWipe    940
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
TheFez    151
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
Cybertron    122
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