From fc10bfd55035d27c9352c1678c3aad87c4be2e09 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 27 Nov 2013 16:10:20 +0100 Subject: Correct debug bit setting with WGL No need to tie the debug bit to OpenGL 3.0+. xcb is correct in this respect, let's correct the windows plugin too. Change-Id: I13ea48de067d3fb61575be8f71b97bb547d8eb02 Reviewed-by: Friedemann Kleint Reviewed-by: Gunnar Sletta --- src/plugins/platforms/windows/qwindowsglcontext.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp index b7de368fa8..82deb0f473 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp @@ -586,15 +586,17 @@ static HGLRC createContext(const QOpenGLStaticContext &staticContext, attributes[attribIndex++] = WGL_CONTEXT_MINOR_VERSION_ARB; attributes[attribIndex++] = minorVersion; } + + int flags = 0; + if (format.testOption(QSurfaceFormat::DebugContext)) + flags |= WGL_CONTEXT_DEBUG_BIT_ARB; if (requestedVersion >= 0x0300) { - attributes[attribIndex++] = WGL_CONTEXT_FLAGS_ARB; - attributes[attribIndex] = 0; if (!format.testOption(QSurfaceFormat::DeprecatedFunctions)) - attributes[attribIndex] |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; - if (format.testOption(QSurfaceFormat::DebugContext)) - attributes[attribIndex] |= WGL_CONTEXT_DEBUG_BIT_ARB; - attribIndex++; + flags |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; } + attributes[attribIndex++] = WGL_CONTEXT_FLAGS_ARB; + attributes[attribIndex++] = flags; + if (requestedVersion >= 0x0302) { switch (format.profile()) { case QSurfaceFormat::NoProfile: -- cgit v1.2.3