Print only part of a stack trace

JN 666total at wp.pl
Wed Jul 1 19:33:08 UTC 2020


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.


More information about the Digitalmars-d-learn mailing list