PDA

View Full Version : pseudo register for glGetError



zero_t9
04-08-2005, 10:24 PM
Gurus, Hi:

Anybody know if there is a pseudo register equivalent to glGetError? Similar with @err for

MS Windows Platform SDK:
DWORD GetLastError(VOID);

thanks,

tSb

zeckensack
04-09-2005, 06:01 AM
Originally posted by /* tSb */:
Gurus, Hi:

Anybody know if there is a pseudo register equivalent to glGetError? Similar with @err for

MS Windows Platform SDK:
DWORD GetLastError(VOID);

thanks,

tSbWhat exactly do you mean?
1)"sticky" error codes that you can get multiple times?
2)a list of multiple error codes?

Both are not available in OpenGL, you'd have to devise your own machinery on top of glGetError.

But honestly, I find the Win32 error management pretty awkward. I have nothing against point #2, but point #1 is just silly. It makes my error management unneccessarily complex (check error_code!=previous_error_code) and as I do it in exactly one place all the time, I do not benefit at all.
It also makes it impossible to detect multiple errors with the same code occuring in a row.

I'm quite happy with the GL approach to errors personally. The only GL error that should be allowed to occur at all in a "release" version of a program should be GL_OUT_OF_MEMORY. That one you should check for when allocating large objects.
Everything else should be found and squished during development.

Humus
04-10-2005, 05:04 AM
Originally posted by zeckensack:
But honestly, I find the Win32 error management pretty awkward. I have nothing against point #2, but point #1 is just silly. It makes my error management unneccessarily complex (check error_code!=previous_error_code) and as I do it in exactly one place all the time, I do not benefit at all.
It also makes it impossible to detect multiple errors with the same code occuring in a row.Why not just call SetLastError(0) after you checked the error?

zero_t9
04-10-2005, 02:06 PM
Hi,

If you are windows programmer and you never used @err, then definitely you should take a look at what it means. Basiclly, you can remove all calls to GetLastError() and put @err at watch window during your debugging.

So, it will be very helpful if we have a pseudo register for opengl glGetError() so that I don't have to call this func and get the last error information.

zero

sqrt[-1]
04-10-2005, 02:49 PM
Just use a tool like GLIntercept: http://glintercept.nutty.org

It will flag to your IDE debugger window whenever a OpenGL error occurs. (Just turn off the logging features)
(You can even set it to break into your IDE when a OpenGL error occurs)