Advertisement

Fix in tutorials (Cocoa versions)

Started by August 08, 2005 11:41 PM
-1 comments, last by valiantsoul 19 years, 1 month ago
I just got through tutorial 2 (cocoa version - I skipped the previous one) however when switching to full screen mode, OpenGL wouldn't initialize. I then downloaded the source code and compared my sources and found it had the same problem. To fix the problem, in "- (NSOpenGLPixelFormat *)createPixelFormat:(NSRect)frame", you need to set the following attributes (new ones are *d) * pixelAttributes[pixNum++] = NSOpenGLPFANoRecovery; * pixelAttributes[pixNum++] = NSOpenGLPFAScreenMask; * pixelAttributes[pixNum++] = CGDisplayIDToOpenGLDisplayMask(kCGDirectMainDisplay); pixelAttributes[pixNum++] = NSOpenGLPFADoubleBuffer; pixelAttributes[pixNum++] = NSOpenGLPFAAccelerated; pixelAttributes[pixNum++] = NSOpenGLPFAColorSize; pixelAttributes[pixNum++] = colorBits; pixelAttributes[pixNum++] = NSOpenGLPFADepthSize; pixelAttributes[pixNum++] = depthBits; Now full screen is happy and working (found via Apple documentation). I'm not sure if this is the NeHe basecode or other tutorials but I thought I would post it anyways.

This topic is closed to new replies.

Advertisement