diff src/video/quartz/SDL_QuartzGL.m @ 1737:eacc5bc01d1c

Implemented bug #5 Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 27 Apr 2006 08:39:51 +0000
parents 3b2a92126f4d
children acfd00fbff5c
line wrap: on
line diff
--- a/src/video/quartz/SDL_QuartzGL.m	Thu Apr 27 07:59:16 2006 +0000
+++ b/src/video/quartz/SDL_QuartzGL.m	Thu Apr 27 08:39:51 2006 +0000
@@ -112,6 +112,10 @@
         attr[i++] = NSOpenGLPFANoRecovery;
     }
 
+    if ( this->gl_config.accelerated > 0 ) {
+        attr[i++] = NSOpenGLPFAAccelerated;
+    }
+
     attr[i++] = NSOpenGLPFAScreenMask;
     attr[i++] = CGDisplayIDToOpenGLDisplayMask (display_id);
     attr[i] = 0;
@@ -242,8 +246,22 @@
             glGetIntegerv (GL_ALPHA_BITS, &component); bits += component;
 
             *value = bits;
+            return 0;
         }
-        return 0;
+        case SDL_GL_ACCELERATED_VISUAL:
+        {
+            long val;
+            [fmt getValues: &val forAttribute: NSOpenGLPFAAccelerated attr forVirtualScreen: 0];
+            *value = val;
+            return 0;
+        }
+        case SDL_GL_SWAP_CONTROL:
+        {
+            long val;
+            [ gl_context getValues: &val forParameter: NSOpenGLCPSwapInterval ];
+            *value = val;
+            return 0;
+        }
     }
 
     glGetIntegerv (attr, (GLint *)value);