diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp index 0ef9f931c2..544f5e2c8c 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp @@ -704,7 +704,7 @@ QWindowsOpenGLContextFormat QWindowsOpenGLContextFormat::current() // v3 onwards GLint value = 0; glGetIntegerv(GL_CONTEXT_FLAGS, &value); - if (value & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT) + if (!(value & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT)) result.options |= QSurfaceFormat::DeprecatedFunctions; if (value & WGL_CONTEXT_DEBUG_BIT_ARB) result.options |= QSurfaceFormat::DebugContext; diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp index b7f0b14c70..d4998432d9 100644 --- a/src/plugins/platforms/xcb/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/qglxintegration.cpp @@ -179,7 +179,7 @@ static void updateFormatFromContext(QSurfaceFormat &format) // a debug context GLint value = 0; glGetIntegerv(GL_CONTEXT_FLAGS, &value); - if (value & ~GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT) + if (!(value & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT)) format.setOption(QSurfaceFormat::DeprecatedFunctions); if (value & GLX_CONTEXT_DEBUG_BIT_ARB) format.setOption(QSurfaceFormat::DebugContext);