FullScreen overrides menu drawing

Member
Posts: 157
Joined: 2002.12
Post: #1
Hello all.
My game is improving everyday, and part of the reason for that is the help I get from you guys thank you!.

Here's my challenge.

When I switch to full screen and a menu/window is selected, they get overriden by the openGL drawing.

Is there a way to shield the menu drawing?
I could pause the drawing, but I would like to keep animations going.

I'm doing the full screen through the Quicktime API because the opengl implementation hides the menubar.

Any ideas?

[Image: mf.jpg]
Quote this message in a reply
w_reade
Unregistered
 
Post: #2
Heh. Well, I know that if you capture the screen with CG, then the menubar is still extant and active, happily accepting clicks and drawing menus over the top of fullscreen OpenGL... it's just that it doesn't draw unless I'm tracking a menu, which would only ever happen accidentally when I was doing it (hidden cursor).

I got round it by setting the mouse to the centre of the screen when I finish launching and on every subsequent NSMouseMoved event; however, you could possibly do it by having a menubar-height "button" saying "menu" at the top-left of the screen; clicking on it would automagically give you the menubar to play with... probably Wink. Oh, hang on, maybe the menubar never appeared, just the menus...? Been too long, can't remember.

Your game looks cool, though.
Quote this message in a reply
Member
Posts: 57
Joined: 2002.04
Post: #3
Quote:Originally posted by w_reade
Heh. Well, I know that if you capture the screen with CG, then the menubar is still extant and active, happily accepting clicks and drawing menus over the top of fullscreen OpenGL... it's just that it doesn't draw unless I'm tracking a menu, which would only ever happen accidentally when I was doing it (hidden cursor).


Doesn't a call to HideMenuBar() fix this? It seems to in the CGL app I'm working on. However, if I'm reading his post correctly, I think that the original poster wants menus, windows, etc. to draw, but OpenGL is drawing over them. Instead of switching to fullscreen, I'd create a window without a title bar or drop shadow (kWindowPlainDialogProc window type with the kWindowNoShadowAttribute attribute set should work), make it fill the entire screen minus the menu bar height, and use AGL (or the Cocoa equivalent; I think it's NSOpenGLView) to attach your OpenGL context to the window.
Quote this message in a reply
Member
Posts: 157
Joined: 2002.12
Post: #4
The window would work, but if the user is running at high resolution(1024+), my game performance will go really bad.

When game goes into full screen resolution at which the scene is render does not change.
At the moment the game runs at 800x600 pixels.
Quote this message in a reply
Member
Posts: 57
Joined: 2002.04
Post: #5
You can still switch the resolution to 800 by 600 when your program starts up; here's the code to do it with Direct Display:

[SOURCECODE]CGDisplayCapture( kCGDirectMainDisplay);
CGDisplaySwitchToMode(kCGDirectMainDisplay, CGDisplayBestModeForParameters( kCGDirectMainDisplay, 32, 800, 600, 0));[/SOURCECODE]

You'd also have to call CGReleaseAllDisplays(); when your application quits; the display should then automatically switch back to the user's original resolution.
Quote this message in a reply
Member
Posts: 157
Joined: 2002.12
Post: #6
Hmm, let me try that...
thank you Rolleyes
Quote this message in a reply
Member
Posts: 177
Joined: 2002.08
Post: #7
Quartz will automatically restore the display when you quit anyway, but it's good practice to explicitly call the method. It's also the way to release the display if you *don't* want to quit afterwards Rasp
Quote this message in a reply
Post Reply