PDA

View Full Version : Double-Buffering with NSOpenGLView


DesertPenguin
2006.07.31, 11:38 PM
While googling I have noticed several comments indicating that the NSOpenGLView does not support double-buffering and that initWithFrame is not called.

After reviewing and debugging some of Apples samples though, it appears that subclasses of NSOpenGLView do support buffering and intiWithFrame.

I am starting a new cocoa-based opengl app, and wanted to verify this before going down the wrong path.

I also found OneSadCookie's GameShell. I was planning to look deeper into it. Has anybody used for any of their projects?

Thanks for any feedback.....
:blink:

OneSadCookie
2006.07.31, 11:41 PM
http://tips.onesadcookie.net/tips/published/Making+NSOpenGLViews+in+Interface+Builder

Yes, I've used my GameShell ;)

Outnumbered, here, uses it: http://onesadcookie.com/Software/

arekkusu
2006.08.01, 01:57 AM
http://developer.apple.com/qa/qa2004/qa1167.html

DesertPenguin
2006.08.01, 11:17 AM
Thanks for the quick replies - GameShell looks like it has what I want from a starting point. <Potential future questions on this ;-) >

For the record, it looks like the Apple sample NSOpenGL Fullscreen -at http://developer.apple.com/samplecode/NSOpenGL_Fullscreen/index.html, still uses a subclass of NSOpenGLView.

But on the Nib they use a CustomView - not OpenGLView - and point it's custom class attribute to their new subclass of NSOpenGLView. Thus, they still use initWithFrame and can set the pixel format programmatically for double-buffering. They also get the built-in NSOpenGLView functionality(albeit which doesn't look like much - just a pre-wired GLContext attribute anyway).