This removes the final access to OpenGL from the rest of the source, with the exception of the glFinish call in the swap code.