Reset error flag in checkGLError

From API doc:
glGetError should always be called in a loop, until it returns
GL_NO_ERROR.

REVIEW: 105127
This commit is contained in:
Martin Gräßlin 2012-06-01 15:26:17 +02:00
parent bc1b769d7f
commit 13fcc29d40

View file

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