roughly implement some opengl wrapper, chapter 2