PDA

View Full Version : SuperBible Code Misbehaving



musasabi
02-05-2012, 11:22 AM
I'm working my way through the Blue Book and have stumbled upon one of the examples that doesn't execute properly. I typed it all out myself first, but when I didn't get the desired results, I copied in the code straight from the zip file from their website. That produced the same oddities, unfortunately. A little reading told me that the most up to date code they've got is on their Google SVN. But, again, it misbehaved (identically to the other two attempts).

The code I'm trying to compile is Objects.cpp, the second listing from Chapter 4. It's just supposed to render a 3D object and cycle through the few it's got when you hit the space bar.

The problem is, I can see no sphere or torus, and the cylinder is mutated. The last two shapes, the cone and the disk, seem fine.

I'm running Arch Linux and I've got freeglut 2.8.0-1 and mesa 7.11.2-1. I'm compiling with gcc 4.6.2-6. Any tips?

(The code: http://oglsuperbible5.googlecode.com/svn/trunk/Src/Chapter04/Objects/Objects.cpp )