CS 324 Computer Graphics, Homework #1

Due: Wednesday, September 3, 9:30am.
  1. Read CGO Chapter 1 (pages 1-38)
  2. Obtain a working UI CS computer account.
  3. Send jeffery@cs.uidaho.edu an e-mail with your preferred e-mail address.
  4. Add /net/special/jeffery/324/bin to your CS lab UNIX path variable, your CPATH variable, and your LIBRARY_PATH variable. Typically you add this in your ~/.cshrc and then "source ~/.cshrc". Your .cshrc line might look like:
    set path=(/net/special/jeffery/324/bin $path)
    setenv CPATH /net/special/jeffery/324
    setenv LIBRARY_PATH /net/special/jeffery/324
    
    or (bourne-style shells):
    export PATH=/net/special/jeffery/324/bin:$PATH
    export CPATH=/net/special/jeffery/324
    export LIBRARY_PATH=/net/special/jeffery/324
    
  5. Make a class directory, e.g. "mkdir ~/324"
  6. Store the following program in a file, e.g. "~/324/hw1.c" :
    short form longer form
       #include "uigui.h"
       int main() {
          WOpen("hw0");
          DrawPoint(25, 25);
          Event();
       }
    
       #include "uigui.h"
       int main() {
          Window win = Wopen("hw0");
          WDrawPoint(win, 25, 25);
          WEvent(win);
       }
    
    Similarly store the following program in a file, e.g. "~/324/hw1.icn" :
    	procedure main()
    	   win := open("hw0","g")
    	   DrawPoint(win, 25, 25)
    	   Event(win)
    	end
    
  7. Compile and run the program both ways:
    	cd ~/324
    	gcc hw1.c -o hw1 -luigui -lz -lXpm -ljpeg -lGL -lGLU -lX11 -lm
    	./hw1
    	unicon hw1
    	./hw1