The default behavior should be double buffered, not singlebuffered

Without this, it is not possible to do vsync drawing on NVidia
GeForce 210 on Windows 7.

Change-Id: I6064826eaa55266344393f50cdf5d17113350255
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
This commit is contained in:
Gunnar Sletta 2013-04-03 16:05:03 +02:00 committed by The Qt Project
parent b3a505dc92
commit fdf10003b6

View File

@ -279,7 +279,7 @@ static PIXELFORMATDESCRIPTOR
if (format.stereo())
pfd.dwFlags |= PFD_STEREO;
if (format.swapBehavior() == QSurfaceFormat::DoubleBuffer && !isPixmap)
if (format.swapBehavior() != QSurfaceFormat::SingleBuffer && !isPixmap)
pfd.dwFlags |= PFD_DOUBLEBUFFER;
pfd.cDepthBits =
format.depthBufferSize() >= 0 ? format.depthBufferSize() : 32;
@ -389,12 +389,11 @@ static int choosePixelFormat(HDC hdc,
iAttributes[i++] = WGL_COLOR_BITS_ARB;
iAttributes[i++] = 24;
switch (format.swapBehavior()) {
case QSurfaceFormat::DefaultSwapBehavior:
break;
case QSurfaceFormat::SingleBuffer:
iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB;
iAttributes[i++] = FALSE;
break;
case QSurfaceFormat::DefaultSwapBehavior:
case QSurfaceFormat::DoubleBuffer:
case QSurfaceFormat::TripleBuffer:
iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB;