I was recently asked by a client for some code that shows how to do the basic SDL and OpenGL initialization needed to write a 3D application on Linux. I pulled out some of the code from my old 3D graphics engine and whittled it down to something appropriately sized. I also had an ulterior motive in putting this example together: another post to this blog, source code included. Features included:
- Display lists incorporated into the rendering loop.
- “Picking” support. [The ability to determine the 3D object under a 2D screen/mouse coordinate.]
- Well written and commented C++ code.