roughly implement some opengl wrapper, chapter 3