Comparing the program with the result it should be immediately obvious what is going on. In a 'C' program the DrawGen process is driven by a series of commands which all begin with 'DG_'.
The first one should always be 'DG_make(<filename>);'. This tells the system you're about to start building a drawfile, and the filename you want. (For my examples, I'll assume the output is always being put on the ramdisc, but you can change the file's address to anything you like.)
Then come a series of commands which describe the objects you want to appear. In this case we can see:
This includes some commands I'll explain later.
In part 2 I'll explain how to create complex shapes and how to change the other defaults, (line thickness, pattern, text font, etc). That said, you may well be able to work out some of what comes next by playing around and trying the examples! So enjoy!