pseudo register for glGetError

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

Originally posted by /* tSb */:
[b]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[/b]
What 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.

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?

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

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)