Full Screen Event Handling
I am smack dab in the middle of rewriting my OpenGL base code. My previous version was done in Carbon and im moving it to Cocoa. I hit a small bump in the road however.
I am using the Keyup: Keydown: events then calling a processing function to determine what has been hit since the last call. I have a subclassed version of NSView that I am rendering my windowed context into. I can pass that as a first responder and everything works fine. However I am unsure how to give first responder rights to my full screen context. Everything I have found in the documentation is relating to passing first responder to an NSWindow.
I am capturing the full screen with this sudo code.
As always thanks in advance everyone.
I am using the Keyup: Keydown: events then calling a processing function to determine what has been hit since the last call. I have a subclassed version of NSView that I am rendering my windowed context into. I can pass that as a first responder and everything works fine. However I am unsure how to give first responder rights to my full screen context. Everything I have found in the documentation is relating to passing first responder to an NSWindow.
I am capturing the full screen with this sudo code.
Code:
NSOpenGLPixelFormat *pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];
fullScreenContext = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:NULL];
CGCaptureAllDisplays();
[fullScreenContext setFullScreen];
[fullScreenContext makeCurrentContext];As always thanks in advance everyone.
If you use the new Leopard NSView API -[enterFullScreenMode:withOptions:] then everything will just work, but you won't get the benefits of a true full-screen context.
I've found the easiest way to handle events with a true full-screen context is to subclass NSApplication and do the processing in -sendEvent: . See http://onesadcookie.com/svn/GameShell for an example.
I've found the easiest way to handle events with a true full-screen context is to subclass NSApplication and do the processing in -sendEvent: . See http://onesadcookie.com/svn/GameShell for an example.
hey,
maybe you just take a look at my new tutorial, I posted in the contests forum:
http://www.idevgames.com/forum/showthread.php?t=15117
please let me know, if this tutorial was helpful to you!
greetings,
stefan
maybe you just take a look at my new tutorial, I posted in the contests forum:
http://www.idevgames.com/forum/showthread.php?t=15117
please let me know, if this tutorial was helpful to you!
greetings,
stefan
I've made my Cocoa fullscreen transition. I was using the Leopard enterFullScreenMode call before but I've written a Cocoa controller now that goes to the selected resolution. Appears to work. Though, the iShowU video capture program seems to like enterFullScreenMode better for some reason. Tried it with window dragging and multiple monitors. Drag the window to the other monitor then go fullscreen on that monitor. Little more tricky than using main display id. The CGGetDisplaysWithRect is useful to get the display id.
Anyhow, I was reading about Snow Leopard. They suggest there is some kind of resolution free scheme? Something I should be aware of?
Anyhow, I was reading about Snow Leopard. They suggest there is some kind of resolution free scheme? Something I should be aware of?
Resolution independence has existed in various forms of completion since Tiger. You can use Quartz Debug to change the UI resolution to test your app with it.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Cocoa/OpenGL drawing full-screen problem | ultitech | 5 | 7,035 |
Jan 13, 2011 01:11 PM Last Post: SethWillits |
|
| Full screen mouse events | Mister T | 17 | 7,491 |
Jan 4, 2010 02:55 PM Last Post: MacMan |
|
| Carbon events in windowed/full screen mode. Help needed. | Anton Petrov | 1 | 3,164 |
Dec 18, 2008 05:35 AM Last Post: DoG |
|
| Full-screen without OpenGL | George Marlin | 2 | 2,620 |
May 11, 2007 01:38 PM Last Post: George Marlin |
|
| Event Handling (Keyboard and Mouse) | bwalters | 6 | 6,615 |
Mar 12, 2006 08:17 PM Last Post: OneSadCookie |
|

