better error reporting for OpenGL state