summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsglcontext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsglcontext.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index d63149e4ce..281f54a9d9 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: