src/video/cocoa/SDL_cocoaopengl.m
changeset 8601 4c04c7785cba
parent 8278 e60a7bb2b80b
child 8604 459bd7365e9d
     1.1 --- a/src/video/cocoa/SDL_cocoaopengl.m	Mon Mar 10 21:21:35 2014 -0400
     1.2 +++ b/src/video/cocoa/SDL_cocoaopengl.m	Mon Mar 10 18:45:07 2014 -0700
     1.3 @@ -162,7 +162,9 @@
     1.4  Cocoa_GL_CreateContext(_THIS, SDL_Window * window)
     1.5  {
     1.6      SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
     1.7 +/*
     1.8      const GLubyte *(APIENTRY * glGetStringFunc)(GLenum) = NULL;
     1.9 +*/
    1.10      NSAutoreleasePool *pool;
    1.11      SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
    1.12      SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata;
    1.13 @@ -249,7 +251,7 @@
    1.14  
    1.15      fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attr];
    1.16      if (fmt == nil) {
    1.17 -        SDL_SetError ("Failed creating OpenGL pixel format");
    1.18 +        SDL_SetError("Failed creating OpenGL pixel format");
    1.19          [pool release];
    1.20          return NULL;
    1.21      }
    1.22 @@ -263,7 +265,7 @@
    1.23      [fmt release];
    1.24  
    1.25      if (context == nil) {
    1.26 -        SDL_SetError ("Failed creating OpenGL context");
    1.27 +        SDL_SetError("Failed creating OpenGL context");
    1.28          [pool release];
    1.29          return NULL;
    1.30      }
    1.31 @@ -272,10 +274,22 @@
    1.32  
    1.33      if ( Cocoa_GL_MakeCurrent(_this, window, context) < 0 ) {
    1.34          Cocoa_GL_DeleteContext(_this, context);
    1.35 -        SDL_SetError ("Failed making OpenGL context current");
    1.36 +        SDL_SetError("Failed making OpenGL context current");
    1.37          return NULL;
    1.38      }
    1.39  
    1.40 +/* No other backend does this version checking.
    1.41 +   If we enable it, we should consider whether it should be done at a 
    1.42 +   higher level for all platforms. We'll have to think through the implications
    1.43 +   of this.
    1.44 +
    1.45 +   For example, Mac OS X 10.6 will only report OpenGL 2.0, but we ask for 2.1
    1.46 +   by default. If we don't get 2.1, then the renderer will set the requested
    1.47 +   version and try to recreate the window, which causes all kinds of problems.
    1.48 +
    1.49 +   For now, we'll just disable this code until we can think about it more.
    1.50 +*/
    1.51 +#if 0
    1.52      glGetStringFunc = (const GLubyte *(APIENTRY *)(GLenum)) SDL_GL_GetProcAddress("glGetString");
    1.53      if (!glGetStringFunc) {
    1.54          Cocoa_GL_DeleteContext(_this, context);
    1.55 @@ -305,6 +319,7 @@
    1.56  
    1.57      _this->gl_config.major_version = glversion_major;
    1.58      _this->gl_config.minor_version = glversion_minor;
    1.59 +#endif
    1.60  
    1.61      return context;
    1.62  }