/***************************************************************************** Line drawing subroutine for CS480 Programming Assignment 1 ****************************************************************************** Author: ******************************************************************************/ #include #include #include #include "draw.h" void draw_line(pixmap,p0,p1,color) Pixmap *pixmap; /* a pixmap */ Screencoord p0[2],p1[2]; /* the start and end points of the line */ Colorindex color; /* the desired line color */ { /* Write a modified version of the midpoint algorithm for scan converting lines (Program 3.2 in the book) to handle lines at any angle. First scan convert the line to the pixmap, and then post the pixmap to the window */ /* There are macros for reading and writing pixels to the pixmap provided in the include file "draw.h" */ }