From 13fcc29d4083c9115147a116084cceb191376b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 1 Jun 2012 15:26:17 +0200 Subject: [PATCH] Reset error flag in checkGLError From API doc: glGetError should always be called in a loop, until it returns GL_NO_ERROR. REVIEW: 105127 --- libkwineffects/kwinglutils.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libkwineffects/kwinglutils.cpp b/libkwineffects/kwinglutils.cpp index f59afbf4e7..e237c1b12c 100644 --- a/libkwineffects/kwinglutils.cpp +++ b/libkwineffects/kwinglutils.cpp @@ -164,11 +164,13 @@ static QString formatGLError(GLenum err) bool checkGLError(const char* txt) { GLenum err = glGetError(); - if (err != GL_NO_ERROR) { + bool hasError = false; + while (err != GL_NO_ERROR) { kWarning(1212) << "GL error (" << txt << "): " << formatGLError(err); - return true; + hasError = true; + err = glGetError(); } - return false; + return hasError; } int nearestPowerOfTwo(int x)