Archived

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

DirectX Problem

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

Can anyone explain to me what needs to be done to make a DirectX program restore correctly after being minimized? All of the SDK examples do it correctly, but I can''t figure out what part of the code does this. Thanks. Kaellaar

Share this post


Link to post
Share on other sites
when you gain focus again, just restore your surfaces with the Restore() member of IDirectDrawSurfaceX

ie. surface->Restore();

Share this post


Link to post
Share on other sites
Just a few things.

If you''re using DirectX 7 just call
llpdirectdraw7->RestoreAllSurfaces();

it''s new to version 7 and is a great shortcut.

And another thing, by restoring the surfaces, it doesn''t restore the contents of them, it merely "re-grabs" the memory where the surface will reside. It''s not likely, but possible that the surfaces will be written over. You will need to load all of your graphics back onto the surfaces after restoring them just to be sure though.

Share this post


Link to post
Share on other sites