AGL switch from fullscreen to windowed

Hi folks,

can someone please help me on this?
I set fullscreen with aglSetFullScreen, i know how to do a window
and how to switch from window to full.

But what steps are required to switch to windowed, once i am in
fullscreen? On top with the nice fading aglSetFullscreen does?

Another (curios) thing: when i try to crate the pixelformat
AGL_FULLSCREN
AGL_RGBA
AGL_NO_RECOVERY
AGL_SINGLE_RENDERER
AGL_DOUBLEBUFFER
AGL_NONE

the cration fails, without AGL_FULLSCREN or even with
AGL_WINDOW it works fine and i get my fullscreen.
Im doing it with AGL, Carbon, C++ on 10.4.

Any ideeas?
Binary

http://onesadcookie.com/book shows how.

Note: the code there may still use aglSetFullScreen(0, 0, 0, 0) – that broke in 10.4.

Once you’ve created your AGLContext, you don’t need to re-create an OpenGL context if you change resolution or switching back to the windowed mode.

Instead, just change your resolution back to the original display mode with CGDisplaySwitchToMode

Then call aglSetCurrentContext then aglUpdateContext and finally aglSetFullScreen(<your context>, 0, 0, 0, 0);

This is working for me on MacOS 10.4.4

I can switch back from windowed / fullscreen or switching resolution.

Hi,

thanks for your help so far!

Im still working on implementig yor tips,
by now the switching is working at long last.

But … :slight_smile:
Now the fullscreen isnt drawn at all and if i
quit the app the desktop keeps black too,
untill i drag some window around and cause it
to be redrawn by the system.

Before quitting i aglSetCurrentContext(NULL)
and destroy all contexts i’ve created. Then i
pass the event to the default window handler
(CallNextEventHandler) to do whats left.

I have this problem only when specifying a GDevice
with aglChoosePixelformat. Do i have to release the
GDvice somehow? (i do a ReleaseWindow(win))

I admit, i totally missed the CDGDisplay Api.
It’s still not fully documented, what parameter
do i have to pass for ‘mode’ in
CGDisplaySwitchToMode(CGDirectDisplayID display, CFDictionaryRef mode)?

Many thanks!

Hi,

i got it working now with the 2-Contexts solution.
The problems i had were solved by seting the drawable
to nil for fullscreen and destroying the fullscreen context
to get back to the window.

I had no luck with CGDisplaySwitchToMode.

Many thanks!
Binary

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.