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.
This commit is contained in:
Johannes Schickel 2014-01-21 23:52:20 +01:00
parent 10a3b3e960
commit 0f36a56b81

View File

@ -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);