Fullscreen SDL/OpenGL & CMD-TAB problem
Hi guys...
In GooBall, we're using SDL to change screen res & go fullscreen for our OpenGL rendering. However, once we've done this, our app just ignores CMD-TAB.
Any pointers on how to fix this?
TIA,
Nicholas
In GooBall, we're using SDL to change screen res & go fullscreen for our OpenGL rendering. However, once we've done this, our app just ignores CMD-TAB.
Any pointers on how to fix this?
TIA,
Nicholas
Are you sure you want to fix it? When you use a real fullscreen GL context, you are telling the system that you want total control of all VRAM and optimal hardware pageflipping. The window manager goes away at this point, so Cmd-Tab, Dock etc are inactive.
The alternative is to make a regular windowed context, hide the menu bar, and size the context to the screen. But in this case, the window manager is still eating X MB of framebuffer, and still composites your view into the display which eats some performance. Additionally, VBL sync doesn't work as well on some (ATI) systems.
IMHO it is better to just lose Cmd-Tab, and let the user switch to windowed mode with Esc or Cmd-F.
The alternative is to make a regular windowed context, hide the menu bar, and size the context to the screen. But in this case, the window manager is still eating X MB of framebuffer, and still composites your view into the display which eats some performance. Additionally, VBL sync doesn't work as well on some (ATI) systems.
IMHO it is better to just lose Cmd-Tab, and let the user switch to windowed mode with Esc or Cmd-F.
What we would want would be to have CMD-TAB just go to the desktop (Or Finder, or whatever). Then we hide our app completely. I'm cool with handling it ourselves, the question is just how to notice the CMD-TAB
SDL will give you command and tab key press events won't it?
In a Cocoa app, you can intercept Cmd and Tab as regular NSEvents if you override NSApp's sendEvent method:
Can't help you with integrating that into SDL, though.
Code:
-(void)sendEvent:(NSEvent *)event {
if (([event type] == NSKeyDown) &&
([event modifierFlags] & NSCommandKeyMask) &&
([[event characters] characterAtIndex:0] == '\t')) {
NSLog(@"User pressed Cmd-Tab");
if (fullscreen) [self toggleFull:nil];
return;
}
[super sendEvent: event];
}
Thanks for the code - I always thought CMD-TAB got handled by the system before the app got it.
Integrating with SDL is not a prob - we're hacking it anyways to do R2T.
Integrating with SDL is not a prob - we're hacking it anyways to do R2T.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| OpenGL Alpha Channel Problem | Moganza | 1 | 1,409 |
Jan 19, 2013 08:25 AM Last Post: sealfin |
|
| Mac OSX fullscreen application problem | e40pud | 7 | 5,488 |
Mar 12, 2010 05:41 AM Last Post: OneSadCookie |
|
| Simple OpenGL ES problem | soulstorm | 3 | 3,339 |
May 14, 2009 03:53 PM Last Post: AnotherJake |
|
| SDL/OpenGL fullscreen text rendering | StealthyCoin | 2 | 5,355 |
Mar 26, 2009 09:47 AM Last Post: StealthyCoin |
|
| Opengl picking problem (zip file) | papillon68 | 1 | 3,738 |
Mar 1, 2009 08:49 PM Last Post: chronus |
|

