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:
parent
bc1b769d7f
commit
13fcc29d40
1 changed files with 5 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue