Fix in tutorials (Cocoa versions)
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
Popular Topics
Advertisement