Commits

Leonard Ritter  committed 0e1ecff

darwin: commit 3.2 patch after checkout

  • Participants
  • Parent commits f04f6e5

Comments (0)

Files changed (2)

File utils/mksdl.py

 bindir = os.path.abspath(os.path.join(basedir, 'sdl-bin'))
 targetdir = os.path.abspath(os.path.join(basedir, 'sdl-src'))
 
+PATCH_SDL_OSX_GL32 = os.path.join(THISDIR, 'sdl-osx-gl3.2.patch')
+
 def clone_repo():
     if not os.path.isdir(targetdir):
         cmd = 'hg clone -r {0} {1} {2}'.format(
         if os.system(cmd):
             print("failed :(")
             return
+    if sys.platform == 'darwin':
+        # try to apply patch
+        cmd = 'patch -d {} -p 1 -i {}'.format(targetdir, PATCH_SDL_OSX_GL32)
+        if os.system(cmd):
+            print("applying patch failed :(")
+            return
     return True
 
 def run_win32_build():

File utils/sdl-osx-gl3.2.patch

+diff -r 9612bcd79130 src/video/cocoa/SDL_cocoaopengl.m
+--- a/src/video/cocoa/SDL_cocoaopengl.m	Sun Aug 12 23:10:16 2012 -0700
++++ b/src/video/cocoa/SDL_cocoaopengl.m	Tue Nov 06 09:58:04 2012 +0100
+@@ -92,6 +92,13 @@
+     attr[i++] = NSOpenGLPFADepthSize;
+     attr[i++] = _this->gl_config.depth_size;
+ 
++    if (_this->gl_config.major_version == 3 &&
++        _this->gl_config.minor_version == 2)
++    {
++        attr[i++] = NSOpenGLPFAOpenGLProfile;
++        attr[i++] = NSOpenGLProfileVersion3_2Core;
++    }
++
+     if (_this->gl_config.double_buffer) {
+         attr[i++] = NSOpenGLPFADoubleBuffer;
+     }