return GL_INVALID_OPERATION, when the previous GL command returned no error?
And it didn’t just return one error, it returned thousands of GL_INVALID_OPERATION error messages.
Is there a limit to how many error codes that glGetError() can store? How would I reset it if I wanted to?
[edit]
I just looked at it again, and it’s returning an ENDLESS loop of GL_INVALID_OPERATION error messages.
Why would it do something like this? I thought this removes them:
Woohoo! I figured it out. You can’t call glGetError() when there is no active rendering context,
otherwise you will get stuck in an infinite loop of GL_INVALID_OPERATION errors.
Here’s some better code. Probably better to check each time in case some sneaky thread tries to clear
out the active context while I’m digging through GL errors:
Although it’s probably safer to just check for one error and skip the entire while loop all together! It’s a bloody trap waiting to happen. It’ll crash your app if you’re not careful.
IMHO, kinda ridiculous if you ask me. Querying for error information causes your app to crash.