Reputation:
The "Errors" section in the official docs says "<...> if an error occurs" for certain functions, such as glCreateShader
, or glCreateProgram
. Does that imply only the listed possible errors, or does that also include any unlisted internal errors? I'm guessing it's the latter, seeing as the docs say "This function returns 0 if an error occurs creating the program object" for glCreateProgram
, yet there are no actual possible errors listed. If that is true, is there a way for me to know anything about the potential error in case it happens?
Upvotes: 2
Views: 70
Reputation: 473407
Every OpenGL function can emit certain errors, even if it may not appear to make sense how that particular function could emit that particular error. These errors generally do not represent direct misuse of the API, but instead report a condition that, while you may have caused it, was not necessarily caused by that specific function.
For example, GL_OUT_OF_MEMORY
can be emitted by any function. Even functions that don't logically allocate memory can emit this error, as running out of memory may happen asynchronously. As such, the driver will only report the OOM condition during whatever OpenGL call happens to occur after the lack of memory is discovered.
Because all OpenGL functions can emit these errors, they are not printed on each function's error section to reduce redundancy. But the function's behavior in the event of an error still needs to be specified.
Upvotes: 2