Skip to main content
GameDev.net gamedev.net
🔒 Locked

DirectX Problem

Started by Kaellaar Apr 1, 2000 at 8:54 PM 1 replies 850+ views
Original Post
Kaellaar
Kaellaar
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
shmaLbus
shmaLbus
when you gain focus again, just restore your surfaces with the Restore() member of IDirectDrawSurfaceX

ie. surface->Restore();
-werdup-
iwasbiggs
iwasbiggs
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.
___________________________Freeware development:ruinedsoft.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.