Hello,
After testing on various computers of mine and friends I've noticed that the PAUSE switchback mode works in Windows when running windowed mode, but when you go to fullscreen PAUSE fails and the best you can get is AMNESIA
Is there any reason for this?
I believe it's a DirectX limitation. It's the same for BACKGROUND/BACKAMNESIA BTW - I can't ever remember which one works for which mode, so I always do:
if (set_display_switch_mode(SWITCH_BACKGROUND)) { if (set_display_switch_mode(SWITCH_BACKAMNESIA)) allegro_message("Something, somewhere, went wrong somehow.\n"); }
Kind of what I do, but why would you want your game to continue when someone switches out?
but why would you want your game to continue when someone switches out?
What if it is a simulator or computation program instead? Allegro is not only for games
...or a (networked) multiplayer game for that matter. If the program pauses when in background, the server will think you client is dead, or you will have to pause all other clients and the server when one client loses focus. Not good. Better keep running, but then without rendering anything (simple hook will do the trick).
Is there any reason for this?
Yes. Microsoft has this idea that whenever your program is switched out from the foreground, has the screen resolution changed, etc, Windows should go ahead and clear all of video memory for you.
Once it's done that, it then notifies the driver that hey, you probably want to reset your GPU's context cause I trampled all over it. Then, it notifies the app that all video memory was lost and can't be retrived. Thanks.
Apps are supposed to hold on to all surface data in main memory and be able to resend them on notice.
This made sense in a world of 1 and 2 MB framebuffers and no hardware acceleration, back in 1992 or so.