The traditional way of doing an OpenGL (gCGLPFAFullScreen, CGLSetFullScreen()) have been deprecated. At WWDC this year, in the Snow Leopard OpenGL session, a new all-Cocoa method was shown where you basically just resize the window containing the NSOpenGLView and layer it above the menu bar. This new method was strongly recommended because it plays more nicely with multiple contexts/screens/graphic cards. The new approach doesn't seem to have made it into the 10.6 API documentation, however, and the OpenGL fullscreen demo source is from like 2002 (ProjectBuilder project) and uses the old technique.

I've taken the old NSOpenGLFullScreen sample code and am working on updating it to this new technique. I've gotten full screen working using this new Snow Leopardy approach, and it's great - nice and simple, lots less code to implement, and it's all Cocoa.

What doesn't work 100% correctly, however, is zooming from a regular window to a full-screen window and back again. There are two problems with this:

1) I can't get the OpenGL view to programmatically become first responder after full screen becomes active, though it works fine once you click in the window 2) When I zoom back down from full screen, the close/zoom/minimize buttons are missing from the window.

Most of the examples I've found online of "zooming" to full screen and back involved using two different window instances. I may try that approach if I can't get this working with a single instance.

Anyway, if you want to check out my in-progress update of the full- screen sample code, it can be downloaded from:

http://www.innerloop.biz/code/OpenGL%20Full%20Screen.zip

If you are writing a full-screen only application, you can probably get what you need out of that And if anyone has any insight into how I can get the zoom working 100% correctly, I'd appreciate hearing it. I'll post the correct version once I get it figured out.

Thanks, all.
Jeff

BTW: the texture loading from the original sample code is borked under Snow Leopard, probably due to one of the changes made to NSImage, I'm not too concerned about that right now, though I may look at fixing it once I get the full-screen stuff working correctly.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to