diff options
author | Kurt Pattyn <pattyn.kurt@gmail.com> | 2014-03-11 14:12:46 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-19 20:12:08 +0100 |
commit | 3ff15f1e987e59b5c35224d7f2230905c4a5f3d0 (patch) | |
tree | 9a675c2cc8f11ec22c69d3a27474841e06c34c91 /src/plugins/platforms/windows | |
parent | 379238496d0bf339a717a311e91949deb2e45485 (diff) |
QOpenGLContext: Use color depth information from QSurfaceFormat
When a new QOpenGLContext is requested, the color depth
information is now also taken into account on OS X and WGL.
Task-number: QTBUG-37411
Change-Id: I69d04989a20de3ace041b009fbbdc03fa02cfdf8
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsglcontext.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp index c45c34ae4d..e7e4028079 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp @@ -387,7 +387,12 @@ static int choosePixelFormat(HDC hdc, iAttributes[i++] = WGL_DRAW_TO_WINDOW_ARB; iAttributes[i++] = TRUE; iAttributes[i++] = WGL_COLOR_BITS_ARB; - iAttributes[i++] = 24; + + iAttributes[i++] = (format.redBufferSize() > 0) + && (format.greenBufferSize() > 0) + && (format.blueBufferSize() > 0) ? + format.redBufferSize() + format.greenBufferSize() + format.blueBufferSize() : + 24; switch (format.swapBehavior()) { case QSurfaceFormat::SingleBuffer: iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB; |