The fifth number on each line is an index to the material that this polygon will have. So there you have it. It works okay as long as you don't throw any dodgy files its way. Remember we're trying to keep it simple, so there is no error checking. Okay, so we're smug in the knowledge that this kind of thing actually isn't that difficult.
Lets try something a little more challenging.
Like the program before, we want our function to return a pointer to a display list. This time however we'll be loading textures, mapping them onto surfaces and making normals for smooth shading. If we stick to good software engineering principles all of this is not as horrific as it sounds. For starters, a single function like in the previous program wouldn't be any use. We'll need a number of smaller functions collected together to form a library.