Added OpenGL error check functions.