PDA

View Full Version : obtaining glX errors.



mani
09-17-2003, 10:27 PM
i would like to know how to obtain the GLX generated errors e.g.
GLXBadDrawable, GLXBadCurrentWindow,etc...

OpenGL provides glGetError() for obtaining the openGL generated errors, do we have something similar for glx?

any help is appreciated. Thanks.

john
09-18-2003, 12:13 AM
Hello,

this question should be posted in the Linux forum (because you'd get more people who knew what glX was:-).

Having said that, what you need to do is set up an X error handler. This is mine (as an example):



int xerrorhandler(Display *dsp, XErrorEvent *error)
{
char errorstring[128];
XGetErrorText(dsp, error->error_code, errorstring, 128);

std::cerr << "ack!fatal: X error--" << errorstring << std::endl;
exit(-1);
}

OK, it doesn't HANDLE the errors, but throws its hands up in proverbial horror, but you get the idea. You need to register the handler with



XSetErrorHandler(xerrorhandler);

cheers,
John