Enable multisampling and swap interval by default on cocoa
authorGunnar Sletta <gunnar.sletta@nokia.com>
Thu, 18 Aug 2011 06:23:15 +0000 (08:23 +0200)
committerMorten Johan Sørvig <morten.sorvig@nokia.com>
Thu, 18 Aug 2011 08:14:35 +0000 (10:14 +0200)
Change-Id: If3d1939e6196f5aa6654645d20dab7ad251046fa
Reviewed-on: http://codereview.qt.nokia.com/3138
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
src/platformsupport/cglconvenience/cglconvenience.mm
src/plugins/platforms/cocoa/qcocoaglcontext.mm

index 43d955e..6b03548 100644 (file)
@@ -87,6 +87,9 @@ void *qcgl_createNSOpenGLPixelFormat()
     {
         NSOpenGLPFADoubleBuffer,
         NSOpenGLPFADepthSize, 32,
+        NSOpenGLPFAMultisample,
+        NSOpenGLPFASampleBuffers, (NSOpenGLPixelFormatAttribute)1,
+        NSOpenGLPFASamples, (NSOpenGLPixelFormatAttribute) 8,
         0
     };
 
index e10a50b..c743fcb 100644 (file)
@@ -17,6 +17,10 @@ QCocoaGLContext::QCocoaGLContext(const QSurfaceFormat &format, QPlatformGLContex
 
     m_context = [NSOpenGLContext alloc];
     [m_context initWithFormat:pixelFormat shareContext:actualShare];
+
+    const GLint interval = 1;
+    [m_context setValues:&interval forParameter:NSOpenGLCPSwapInterval];
+
 }
 
 // Match up with createNSOpenGLPixelFormat!