OpenGL context and Windows/Dialogs

Post: #1
Hi all,

I'm currently having a problem under MacOS X; I've created a full-screen GL context via aglSetFullScreen. But then I need sometime to display some windows/dialogs; problem is that any Carbon-based Window or Dialog creation routine creates "invisible" windows: they are there, but not displayed on the screen. Is there a way to have them displayed in the current context, even if they trash the GL rendering? Or the only solution is to destroy the full screen GL context before attempting to display Windows?

Thank you very much for your time!
Quote this message in a reply
Posts: 469
Joined: 2002.10
Post: #2
I think you can get the "shielding window level" from the fullscreenglcontext you created. With that, just set the dialog or window level of the dialog or window you want to display "above" that level. I can do it in Cocoa, but I'm not sure about the details of Carbon. Hope that helps.

15.4" MacBook Pro revA
Quote this message in a reply
Posts: 5,143
Joined: 2002.04
Post: #3
If you have a true fullscreen context (via aglSetFullScreen), you cannot display standard UI elements whilst that context is active.

I think you should be able to detach the context (via aglSetCurrentContext(NULL) and aglClearDrawable), then show your dialogs, then re-attach the context (via aglSetFullScreen) without destroying the context or its textures, display lists, &c.
Quote this message in a reply
Post: #4
Well, detaching the active context seemed a good idea to me, to, but it seems that when I try to re-activate it again, GL doesn't work any more... Sad Maybe I should glFinish()/glFlush() or something before detaching it?...
Quote this message in a reply
Post: #5
I solved the problem! I had to issue a glFinish() before detaching the agl context - now the thing works!

Thank you very much for your kind answers!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Full screen context doesn't remain the current context Malarkey 3 5,425 Feb 1, 2007 05:27 PM
Last Post: OneSadCookie
  cocoa for nibbies [OpenGL context creation/ Initializing a PixelFormat] Byron Clarke 7 6,190 Jun 23, 2005 01:23 AM
Last Post: Byron Clarke
  Multiple OpenGL Windows in Cocoa Adger Stokvisch 13 11,578 Dec 13, 2004 05:40 AM
Last Post: Adger Stokvisch
  Screenshot of OpenGL context aarku 6 10,432 Jul 23, 2004 07:05 PM
Last Post: aarku
  Using OpenGL to make windows, tiles, etc. LongJumper 6 4,891 Oct 7, 2003 09:41 AM
Last Post: inio