Modifying code based on http://www.opengl.org/wiki information