Rewriting for OpenGL 3.2. Not working at the moment.