Cocoa/OpenGL drawing full-screen problem
Hey guys,
I have a little issue here. Im trying to make my NSOpenGLView fullscreen using apple's example here.
But when I toggle fullscreen my view gets all messed up.
I have a window with an OpenGL View and I want just this View to go fullscreen instead of the entire old window.
I got the code from Cocoa with Love.
I would appreciate you help.
I have a little issue here. Im trying to make my NSOpenGLView fullscreen using apple's example here.
But when I toggle fullscreen my view gets all messed up.
I have a window with an OpenGL View and I want just this View to go fullscreen instead of the entire old window.
Code:
NSView *contentView = [[MyOpenGLView alloc] initWithFrame:viewRect pixelFormat: pixelFormat];
[fullscreenWindow setContentView:contentView];I would appreciate you help.
You'll need to be more specific than "my view gets all messed up."
You can use NSView's enterFullScreenMode:withOptions: method to get the view fullscreen. It works with NSOpenGLView too. I'm not sure why Apple's docs don't show this yet.
You can use NSView's enterFullScreenMode:withOptions: method to get the view fullscreen. It works with NSOpenGLView too. I'm not sure why Apple's docs don't show this yet.
Its like OpenGL crashes, pixel errors are all over the fullscreen. Is the method you described good in performance on fullscreen?
If OpenGL crashed, your app or computer would crash with it. What you're seeing is just unwritten-to video memory. That can be caused by a few things.
On 10.5 the fullscreen OpenGL context that results from calling the enterFullScreenMode: method isn't really recognized by the system as being fullscreen, so there's a bit of performance loss, but the amount is insignificant. On 10.6+ it will recognize it, and there's absolutely zero performance loss. It's as fast as can be.
On 10.5 the fullscreen OpenGL context that results from calling the enterFullScreenMode: method isn't really recognized by the system as being fullscreen, so there's a bit of performance loss, but the amount is insignificant. On 10.6+ it will recognize it, and there's absolutely zero performance loss. It's as fast as can be.
Thanks, works perfectly. But I can only access enterFullScreenMode from inside my NSOpenGLView, is that right?
No, it's a public method on NSView just like any other. You can call it from anywhere you want using a pointer to the view. Cocoa doesn't use private methods.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Texture Loading Cocoa/OpenGL | ultitech | 1 | 5,682 |
Jan 31, 2011 12:51 PM Last Post: mk12 |
|
| Full screen mouse events | Mister T | 17 | 7,495 |
Jan 4, 2010 02:55 PM Last Post: MacMan |
|
| Carbon events in windowed/full screen mode. Help needed. | Anton Petrov | 1 | 3,171 |
Dec 18, 2008 05:35 AM Last Post: DoG |
|
| Full Screen Event Handling | kodex | 4 | 4,229 |
Jun 27, 2008 08:37 PM Last Post: OneSadCookie |
|
| Cocoa OpenGL | clapton541 | 3 | 4,526 |
Aug 5, 2007 09:22 PM Last Post: BenRose3d |
|

