Moved some OpenGL code to a separate file.