Jump to content
  • Advertisement

Archived

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

GunnarSteinn

Minimizing fullscreen apps

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

Depends on what you're using ? Are you using Direct3D / DirectDraw ? ... ? If you're using DirectDraw, your surfaces will be lost, so you gotta restore anything. There are some more problems, so some details would be fine.

CU

------------------
Skullpture Entertainment
#40842461

Share this post


Link to post
Share on other sites
Advertisement
I'm using DDraw in 800x600 8-bit mode.
I set the cooperation level like this
lpdd->SetCooperativeLevel(main_window_handle,
DDSCL_ALLOWMODEX | DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE | DDSCL_ALLOWREBOOT)

I'm using the WGPFD engine

Share this post


Link to post
Share on other sites
Hi,
then you've got to restore your surfaces, it's explained in the sources in the sdk. Just a few lines of code.

CU

------------------
Skullpture Entertainment
#40842461

Share this post


Link to post
Share on other sites
Also, if you have loaded anything at all into Video memory, after you restore the surface you will have to reload them with the graphics that go in them.


- Chris

Share this post


Link to post
Share on other sites
In my program based on DX5 Fullscreen,
iv'e controlled minimizing by creating a bActive variable which equals FALSE if the app is non active (iconized),TRUE if the app is FullScreen. (pretty standard)
My bActive is controlled by two WM_ messages (WM_LOSTFOCUS and WM_GAINFOCUS ??), and I have coded my main loop as:

WinMain(bla bla)
{
while(bla bla..
{
{
....translatemessages...
}
if(bActive) DoGameUpdate();
}
}


Make sure when calling DDraw functions, you check the results (ddrval).
If the result is DDRVAL_LOSTSURFACE, imediatelly restore ALL Surfaces using ->restore(), and exit your screen drawing function if ddrval is not DD_OK.
Otherwise if you try to flip and blit to a lost surface, the system will hang!

-=SikCiv=-

Share this post


Link to post
Share on other sites
I'm having a little problem with my game. If I minimize it everything is ok but when I try to maximize it again the program halts and I have to use ctrl+alt+del.
I know I have to use the WM_SIZE message but how?

Share this post


Link to post
Share on other sites
This should do it, just call it before you start rendering anything. (Therefore, it's in my render-function() )

code:

if (FrontBuffer->IsLost() == DDERR_SURFACELOST)
{
FrontBuffer->Restore();
}

------------------
Dance with me......

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!