#include "dim.h" #include #include #include int fb[BUFFWIDTH][BUFFHEIGHT]; /* the simulated frame buffer */ int width=500,height=500; /* initial window size */ float pixwidth = (float) width/BUFFWIDTH; /* simulated pixel width */ float pixheight = (float) height/BUFFHEIGHT; /* simulated pixel height */ int inline inrange(int i, int low, int high) {return((low <= i) && (i <= high));} enum mode {Point, Line}; /* possible modes of program */ mode currmode=Point; /* current point, initially Point */ int vptx0, vptx1, vpty0, vpty1; void init() { glClearColor(0.0,0.0,0.0,0.0); /* clear color is black */ for (int i=0; i