switched opengl book chapter 6