aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorJohannes Schickel2014-01-21 23:52:20 +0100
committerJohannes Schickel2014-01-21 23:52:20 +0100
commit0f36a56b813c4270033804de8dd4f3412bedca55 (patch)
treea77f3c7f6c902bd3a5ca1c6a7d2fa71f3a07df68 /backends
parent10a3b3e9604d5ef1d0bfad8bba639dd082130544 (diff)
downloadscummvm-rg350-0f36a56b813c4270033804de8dd4f3412bedca55.tar.gz
scummvm-rg350-0f36a56b813c4270033804de8dd4f3412bedca55.tar.bz2
scummvm-rg350-0f36a56b813c4270033804de8dd4f3412bedca55.zip
OPENGL: Properly query for OpenGL errors.
There might be various error flags and we need to clear all of them to get precise error results. Thus, we need to call glGetError in a loop to achieve that.
Diffstat (limited to 'backends')
-rw-r--r--backends/graphics/opengl/debug.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/backends/graphics/opengl/debug.cpp b/backends/graphics/opengl/debug.cpp
index 69006bb975..d5d73fb5ec 100644
--- a/backends/graphics/opengl/debug.cpp
+++ b/backends/graphics/opengl/debug.cpp
@@ -52,9 +52,9 @@ Common::String getGLErrStr(GLenum error) {
} // End of anonymous namespace
void checkGLError(const char *expr, const char *file, int line) {
- GLenum error = glGetError();
+ GLenum error;
- if (error != GL_NO_ERROR) {
+ while ((error = glGetError()) != GL_NO_ERROR) {
// We cannot use error here because we do not know whether we have a
// working screen or not.
warning("GL ERROR: %s on %s (%s:%d)", getGLErrStr(error).c_str(), expr, file, line);