I am using QT 4.8.4 and drawing OpenGL on QGraphicsScene background. The problem is that I am getting invalid return from glGetError(). My code snippet:
while (GLenum err = glGetError() != GL_NO_ERROR) {
std::cerr << err;
}
On application output I get a lot of lines with number 1
From the documentation I see possible values are:
GL_NO_ERROR, GL_INVALID_ENUM, GL_INVALID_VALUE, GL_INVALID_OPERATION, GL_INVALID_FRAMEBUFFER_OPERATION, GL_OUT_OF_MEMORY, GL_STACK_UNDERFLOW, GL_STACK_OVERFLOW
which are defined as 0, 0x0500, 0x0501, 0x0502, 0x0503, 0x0504, 0x0505, 0x0506.
How is it possible I get the 1 instead of a proper error code?
This started to happen when I wrapped my native OpenGL drawing code with QT's:
painter->beginNativePainting();
...
painter->endNativePainting();
PS: The multiple 1's are from multiple draw calls and not from the loop.