Don't query for GL_CONTEXT_FLAGS if not at least OpenGL 3.0

Patch by Thomas Lübking.

BUG: 355522
This commit is contained in:
Martin Gräßlin 2015-11-19 11:20:33 +01:00
parent 23784d2038
commit 416d8060cf
2 changed files with 10 additions and 4 deletions

View file

@ -96,9 +96,13 @@ void glResolveFunctions(OpenGLPlatformInterface platformInterface)
} }
} else { } else {
if (haveArbRobustness) { if (haveArbRobustness) {
GLint value = 0; if (hasGLVersion(3, 0)) {
glGetIntegerv(GL_CONTEXT_FLAGS, &value); GLint value = 0;
if (value & GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB) { glGetIntegerv(GL_CONTEXT_FLAGS, &value);
if (value & GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB) {
robustContext = true;
}
} else {
robustContext = true; robustContext = true;
} }
} }

View file

@ -488,8 +488,10 @@ void SceneOpenGL::initDebugOutput()
// empirical data shows extension doesn't work // empirical data shows extension doesn't work
return; return;
} }
} else if (!hasGLVersion(3, 0)) {
return;
} }
// can only be queried with either OpenGL or OpenGL ES of at least 3.1 // can only be queried with either OpenGL >= 3.0 or OpenGL ES of at least 3.1
GLint value = 0; GLint value = 0;
glGetIntegerv(GL_CONTEXT_FLAGS, &value); glGetIntegerv(GL_CONTEXT_FLAGS, &value);
if (!(value & GL_CONTEXT_FLAG_DEBUG_BIT)) { if (!(value & GL_CONTEXT_FLAG_DEBUG_BIT)) {