Fixing the opengl rendering thing. Close to knowing how the heck it works.