Advertisement Jump to content
Sign in to follow this  

Fix in tutorials (Cocoa versions)

This topic is 4916 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!