If swapBehavior is TripleBuffer, set WGL_DOUBLE_BUFFER_ARB to TRUE
authorJan-Arve Saether <jan-arve.saether@nokia.com>
Fri, 20 Jul 2012 14:11:45 +0000 (16:11 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 23 Jul 2012 17:57:07 +0000 (19:57 +0200)
Previously, if the drivers' swap behaviour was single-buffered
it would fallthrough (just like DefaultSwapBehavior) and remain
single-buffered.

Change-Id: I4b93ad7a49094aa992d0b8fb3429c163bbbf655d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
src/plugins/platforms/windows/qwindowsglcontext.cpp

index cabc597..4a67130 100644 (file)
@@ -384,13 +384,13 @@ static int choosePixelFormat(HDC hdc,
     iAttributes[i++] = 24;
     switch (format.swapBehavior()) {
     case QSurfaceFormat::DefaultSwapBehavior:
     iAttributes[i++] = 24;
     switch (format.swapBehavior()) {
     case QSurfaceFormat::DefaultSwapBehavior:
-    case QSurfaceFormat::TripleBuffer:
         break;
     case QSurfaceFormat::SingleBuffer:
         iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB;
         iAttributes[i++] = FALSE;
         break;
     case QSurfaceFormat::DoubleBuffer:
         break;
     case QSurfaceFormat::SingleBuffer:
         iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB;
         iAttributes[i++] = FALSE;
         break;
     case QSurfaceFormat::DoubleBuffer:
+    case QSurfaceFormat::TripleBuffer:
         iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB;
         iAttributes[i++] = TRUE;
         break;
         iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB;
         iAttributes[i++] = TRUE;
         break;