summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsglcontext.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-02-18 20:03:20 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-18 20:03:20 +0100
commit3654a4a3c1cb2ac9bb8b486877d9f1e6a6b220be (patch)
tree611c16caa5096bd1348f188c9072354f1e613a9f /src/plugins/platforms/windows/qwindowsglcontext.cpp
parentc04f3584abd621f09e8f2c81b9c6c87212a993a3 (diff)
parentf4900d340a4c620b56871995741696d28e53c167 (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsglcontext.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index 0ef9f931c2..081b42ce65 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -136,6 +136,10 @@
#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001
#endif
+#ifndef GL_CONTEXT_FLAG_DEBUG_BIT
+#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
+#endif
+
QT_BEGIN_NAMESPACE
template <class MaskType, class FlagType> inline bool testFlag(MaskType mask, FlagType flag)
@@ -696,34 +700,27 @@ QWindowsOpenGLContextFormat QWindowsOpenGLContextFormat::current()
result.version = (version.mid(0, majorDot).toInt() << 8)
+ version.mid(majorDot + 1, minorDot - majorDot - 1).toInt();
}
+ result.profile = QSurfaceFormat::NoProfile;
if (result.version < 0x0300) {
- result.profile = QSurfaceFormat::NoProfile;
result.options |= QSurfaceFormat::DeprecatedFunctions;
return result;
}
// 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)
+ if (value & GL_CONTEXT_FLAG_DEBUG_BIT)
result.options |= QSurfaceFormat::DebugContext;
if (result.version < 0x0302)
return result;
// v3.2 onwards: Profiles
value = 0;
glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &value);
- switch (value) {
- case WGL_CONTEXT_CORE_PROFILE_BIT_ARB:
+ if (value & GL_CONTEXT_CORE_PROFILE_BIT)
result.profile = QSurfaceFormat::CoreProfile;
- break;
- case WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB:
+ else if (value & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT)
result.profile = QSurfaceFormat::CompatibilityProfile;
- break;
- default:
- result.profile = QSurfaceFormat::NoProfile;
- break;
- }
return result;
}