From d24acb7f64d72839f84bce2ed39d50c154ca74ac Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 27 Jul 2011 18:40:41 +0200 Subject: [PATCH] Copied Cocoa entry point bugfix from 2.7.2. --- readme.html | 1 + src/cocoa_init.m | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/readme.html b/readme.html index 96a892a2..12e2e88a 100644 --- a/readme.html +++ b/readme.html @@ -305,6 +305,7 @@ version of GLFW.

  • Bugfix: The FSAA test did not check for the availability of GL_ARB_multisample
  • [Cocoa] Added support for OpenGL 3.2 core profile in 10.7 Lion and above
  • [Cocoa] Bugfix: The loop condition for saving video modes used the wrong index variable
  • +
  • [Cocoa] Bugfix: The OpenGL framework was not retrieved, making glfwGetProcAddress crash
  • [X11] Added support for the GLX_EXT_swap_control extension as an alternative to GLX_SGI_swap_control
  • [X11] Bugfix: Calling glXCreateContextAttribsARB with an unavailable OpenGL version caused the application to terminate with a BadMatch Xlib error
  • [Win32] Removed explicit support for versions of Windows older than Windows XP
  • diff --git a/src/cocoa_init.m b/src/cocoa_init.m index abd4630f..2455d594 100644 --- a/src/cocoa_init.m +++ b/src/cocoa_init.m @@ -201,6 +201,15 @@ int _glfwPlatformInit(void) // Implicitly create shared NSApplication instance [GLFWApplication sharedApplication]; + _glfwLibrary.NS.OpenGLFramework = + CFBundleGetBundleWithIdentifier( CFSTR( "com.apple.opengl" ) ); + if (_glfwLibrary.NS.OpenGLFramework == NULL) + { + _glfwSetError(GLFW_PLATFORM_ERROR, + "glfwInit: Failed to locate OpenGL framework"); + return GL_FALSE; + } + NSString* resourcePath = [[NSBundle mainBundle] resourcePath]; if (access([resourcePath cStringUsingEncoding:NSUTF8StringEncoding], R_OK) == 0)