how to detect glx errors?

We cannot get glx errors by using glGetError. Is there any function to get glx errors(i.e BadValue, BadAlloc)? How can we detect and handle glx errors?

To get the X protocol errors you need to setup your own error handler (see the man page for XSetErrorHandler). Error handling is descriped in depth in the “Xlib Programming Manual”.

– Niels