I want to say that this has been very useful to me as a quick lesson
in OpenGL, while showing the power of SDL as an OpenGL launcher. I have
a tiny suggestion for adding another iota of usefulness:
- float aspect;
…
- glOrtho(-2.0, 2.0, -2.0, 2.0, -20.0, 20.0);
/* This makes the cube equisided on screen */
- aspect = (float)w/(float)h;
- glOrtho(-2.0, 2.0, -2.0/aspect, 2.0/aspect, -20.0, 20.0);