On Wednesday, 1 July 2020 at 18:30:15 UTC, Dennis wrote:
I have a function that checks a global error constant of a C library (OpenGL) like this:
```
void assertNoOpenGLErrors() {
    if (glGetError() != GL_NO_ERROR) {
assert(0); // stack trace points to here instead of caller
    }
}

Bit off-topic, but if you can use them, debug contexts offer much better OpenGL error-checking experience. https://www.khronos.org/opengl/wiki/Debug_Output . Instead of checking glGetError() after each call, you can setup a C callback that will trigger whenever an error occurs. It also offers some vendor-specific performance warnings.

Reply via email to