Is there a way to catch OpenGL errors?
Yes.
When it seems like nothing is happening, OpenGL is often returning an
error message. To check for this, use the following code:
GLenum error_flag;error_flag = glGetError();
if(error_flag != GL_NO_ERROR) {
printf("Error: %1s (%i) in %1s.\n",gluErrorString(error_flag),error_flag,"method name");
}