This is rather odd. Mostly because I have worked extensively with OpenGL and this is something I have never found necessary to do. You might have better success in finding out what the errors were and fixing them. I wrote this function a while ago and it has been useful for me. It generates a text string for the last error code. Here it is :
int GetGLerrorMsg( PSTR buffer, int bufferSize, PCSTR format, ... )
{
va_list args;
va_start( args, format );
int amount = vsnprintf( buffer, bufferSize, format, args );
GLenum errorno = glGetError();
if( errorno != GL_NO_ERROR )
_sntprintf( buffer + amount, bufferSize - amount, " - %d: %s",
errorno, (PCSTR) gluErrorString( errorno ) );
va_end( args );
return errorno;
}
One caveat : it uses the GLU library to generate an error string for the message. This generates a text string with a user defined message along with a textual description of the error. Here is a sample of code that calls it :
GetGLerrorMsg( buffer, bufferSize, "Call of wglCreateContext failed : " );
Note that it accepts variable arguments so you can pass practically anything that can be displayed. From there you can do what you want with the message string such as send it to a debugger, log it to a file, display on a console, etc.