Jump to content
  • Advertisement
Sign in to follow this  
valiantsoul

Fix in tutorials (Cocoa versions)

This topic is 4848 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!