In most cases a C program written for use with the NuGraf library
will look as follows. Sections contained within square brackets are optional for simple
uses of the library but in general must be specified for typical programs:
main() {
Initialize the library
Define user interrupt handler
Define confirmation handler
Define error handler
[ Define textures ]
[ Define surfaces ]
Define objects using built-in geometric primitives
Create instances of the objects
Attach the instances together into a hierarchy
[ Link the surface definitions to the instances ]
[ Set runtime rendering options ]
Define one or more light sources
[ Define one or more cameras ]
Select the output driver
Render the scene
[ Cleanup the library ]
}