summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp11
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp12
2 files changed, 14 insertions, 9 deletions
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index e95eaef420..1063432dcc 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -876,10 +876,6 @@ QWindowsOpenGLContextFormat QWindowsOpenGLContextFormat::current()
result.options |= QSurfaceFormat::DeprecatedFunctions;
if (value & GL_CONTEXT_FLAG_DEBUG_BIT)
result.options |= QSurfaceFormat::DebugContext;
- value = 0;
- QOpenGLStaticContext::opengl32.glGetIntegerv(RESET_NOTIFICATION_STRATEGY_ARB, &value);
- if (value == LOSE_CONTEXT_ON_RESET_ARB)
- result.options |= QSurfaceFormat::ResetNotification;
if (result.version < 0x0302)
return result;
// v3.2 onwards: Profiles
@@ -889,6 +885,13 @@ QWindowsOpenGLContextFormat QWindowsOpenGLContextFormat::current()
result.profile = QSurfaceFormat::CoreProfile;
else if (value & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT)
result.profile = QSurfaceFormat::CompatibilityProfile;
+ if (result.version < 0x0400)
+ return result;
+ // v4.0 onwards
+ value = 0;
+ QOpenGLStaticContext::opengl32.glGetIntegerv(RESET_NOTIFICATION_STRATEGY_ARB, &value);
+ if (value == LOSE_CONTEXT_ON_RESET_ARB)
+ result.options |= QSurfaceFormat::ResetNotification;
return result;
}
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
index f26f698e76..5e5fefca90 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
@@ -163,10 +163,12 @@ static void updateFormatFromContext(QSurfaceFormat &format)
format.setOption(QSurfaceFormat::StereoBuffers);
if (format.renderableType() == QSurfaceFormat::OpenGL) {
- GLint value = 0;
- glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, &value);
- if (value == GL_LOSE_CONTEXT_ON_RESET_ARB)
- format.setOption(QSurfaceFormat::ResetNotification);
+ if (format.version() >= qMakePair(4, 0)) {
+ GLint value = 0;
+ glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, &value);
+ if (value == GL_LOSE_CONTEXT_ON_RESET_ARB)
+ format.setOption(QSurfaceFormat::ResetNotification);
+ }
if (format.version() < qMakePair(3, 0)) {
format.setOption(QSurfaceFormat::DeprecatedFunctions);
@@ -175,7 +177,7 @@ static void updateFormatFromContext(QSurfaceFormat &format)
// Version 3.0 onwards - check if it includes deprecated functionality or is
// a debug context
- value = 0;
+ GLint value = 0;
glGetIntegerv(GL_CONTEXT_FLAGS, &value);
if (!(value & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT))
format.setOption(QSurfaceFormat::DeprecatedFunctions);