PDA

View Full Version : OpenGL TaskSwitching



Sgt. Nukem
01-06-2004, 08:15 AM
What do I have to do when the user wants to ALT-TAB out of my fullscreen OpenGL application?! My MessageHandler receives a WM_ACTIVATE message, but what tasks do I have to do there for getting TaskSwitching to work?! Simply make the rendercontext "uncurrent"?! Or how do your MessageHandlers look like?

Azazel
01-07-2004, 06:21 AM
Why dont switch off timer?

Obli
01-07-2004, 11:05 AM
Where is the problem?
Under some circumstances I was able to get alt-tab working with no trouble at all, transparently to the app.

Of curse, as Azazel pointed out, getting it work is different from getting it work right. Turning off some timers is undoubtly important for some kind of apps like games.

Also, if you're using DirectInput, you may need to unacquire / release devices. Possibly the same thing applies to DirectAudio as well.

Sgt. Nukem
01-10-2004, 12:31 PM
The problem is the resolution and stuff didn't work right. I can't get TaskManager in foreground etc.
I just need to know how to disable OpenGL for the time being.

Obli
01-12-2004, 11:27 AM
Originally posted by Sgt. Nukem:
The problem is the resolution and stuff didn't work right. I can't get TaskManager in foreground etc.
I just need to know how to disable OpenGL for the time being.

Mh, I wrapped everything in my own API some time ago so take this with a grain of salt, it may be horribly wrong.

1- Get the WM_ACTIVATE message. If I am not wrong, it is sent to the app when ALT-TAB is used.
2- Parse it by restoring previous resolution (save it before switching by using that function which also sets the resolution)
3- Hide the window or iconize it. Don't ask me how I do that, I don't remember it!

Depending on window styles, this could take some extra steps.
Sorry to be of little help but so much time has been passed since I faced those problems I don't remember a single line of code of that. I could try to check it out but I'm plenty of TODOs so this would take quite a while.

This message has been posted mainly for the WM_ACTIVATE thing but you probably already know that.