Improved OpenGL utils.