Updated GL version tests for Mac OS X 10.9 ("Mavericks").
authorRyan C. Gordon <icculus@icculus.org>
Mon, 28 Oct 2013 22:43:39 -0400
changeset 7894bb624b1348da
parent 7893 59b3e715fab6
child 7895 a9d1c47bb1aa
Updated GL version tests for Mac OS X 10.9 ("Mavericks").

They changed the name of their GL 3.2 enum, added the GL 4.1 core profile.
src/video/cocoa/SDL_cocoaopengl.m
     1.1 --- a/src/video/cocoa/SDL_cocoaopengl.m	Wed Oct 23 20:58:39 2013 -0700
     1.2 +++ b/src/video/cocoa/SDL_cocoaopengl.m	Mon Oct 28 22:43:39 2013 -0400
     1.3 @@ -54,8 +54,11 @@
     1.4  #ifndef kCGLOGLPVersion_Legacy
     1.5  #define kCGLOGLPVersion_Legacy 0x1000
     1.6  #endif
     1.7 -#ifndef kCGLOGLPVersion_3_2_Core
     1.8 -#define kCGLOGLPVersion_3_2_Core 0x3200
     1.9 +#ifndef kCGLOGLPVersion_GL3_Core
    1.10 +#define kCGLOGLPVersion_GL3_Core 0x3200
    1.11 +#endif
    1.12 +#ifndef kCGLOGLPVersion_GL4_Core
    1.13 +#define kCGLOGLPVersion_GL4_Core 0x4100
    1.14  #endif
    1.15  
    1.16  @implementation SDLOpenGLContext : NSOpenGLContext
    1.17 @@ -179,14 +182,14 @@
    1.18      int i = 0;
    1.19  
    1.20      if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) {
    1.21 -        SDL_SetError ("OpenGL ES not supported on this platform");
    1.22 +        SDL_SetError ("OpenGL ES is not supported on this platform");
    1.23          return NULL;
    1.24      }
    1.25  
    1.26      /* Sadly, we'll have to update this as life progresses, since we need to
    1.27         set an enum for context profiles, not a context version number */
    1.28 -    if (wantver > 0x0302) {
    1.29 -        SDL_SetError ("OpenGL > 3.2 is not supported on this platform");
    1.30 +    if (wantver > 0x0401) {
    1.31 +        SDL_SetError ("OpenGL > 4.1 is not supported on this platform");
    1.32          return NULL;
    1.33      }
    1.34  
    1.35 @@ -197,7 +200,13 @@
    1.36          NSOpenGLPixelFormatAttribute profile = kCGLOGLPVersion_Legacy;
    1.37          if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_CORE) {
    1.38              if (wantver == 0x0302) {
    1.39 -                profile = kCGLOGLPVersion_3_2_Core;
    1.40 +                profile = kCGLOGLPVersion_GL3_Core;
    1.41 +            } else if ((wantver == 0x0401) && (data->osversion >= 0x1090)) {
    1.42 +                profile = kCGLOGLPVersion_GL4_Core;
    1.43 +            } else {
    1.44 +                SDL_SetError("Requested GL version is not supported on this platform");
    1.45 +                [pool release];
    1.46 +                return NULL;
    1.47              }
    1.48          }
    1.49          attr[i++] = kCGLPFAOpenGLProfile;