I am using the OpenGL callback function (see `glDebugMessageCallback`). It is working correctly and prints out the information as expected.
I would like to raise an exception in this call so that I can force an error and get a stack trace. I have:
proc glDebugOutput*(
source: GLenum_t,
ofType: GLenum_t,
id: GLuint_t,
severity: GLenum_t,
length: GLsizei_t,
message: cstring,
userParam: pointer) {.cdecl, raises: [Exception].} =
echo "---------------"
echo fmt"Debug message ({$id}): {message}"
...
...
raise newException(Exception, "glDebugOutput raised exception") When I test this code, the first time the call back is executed, the error message is printed. The application keeps running and thereafter only "---------------" is printed.
My question is: is this possible? Need I do something else to 1) force the application to terminate and 2) get a stack trace.
TIA