As per the following paragraph from learnopengl (I couldn't find a similar explanation elsewhere though):
The moment an error flag is set, no other error flags will be reported. Furthermore, the moment glGetError is called it clears all error flags (or only one if on a distributed system).
However, the documentation states that:
If more than one flag has recorded an error, glGetError returns and clears an arbitrary error flag value.
I understand that the behavior can differ according to which system the code is running on. But does this actually mean that, on non-distributed systems, only one error can ever be returned after one GL call?
// Resetting error flags
GLenum error = glGetError();
while (error != GL_NO_ERROR)
error = glGetError();
glFoo(GL_WRONG_VALUE);
error = glGetError(); // Returns GL_INVALID_ENUM, for example
error = glGetError(); // Can this *ever* return something other than GL_NO_ERROR on non-distributed systems?
(My question is solely about glGetError()'s behavior, the debug callback would be a painless solution but this is something I've been wondering about.)