/**************************************************************************** * Michael Main -- Feb 7, 1992 * * This is a header file for Xturbo.c which is a * C module containing routines to simulate the Turbo C++ graphics * routines in a simple way, using X-windows. * * To use the routines: * 1. In your program put this include statement: * #include "~main/Xturbo.h" * 2. When you compile your program, include these items: * g++ ... ~main/Xturbo.o -L/usr/local/X11/lib -lX11 * The "..." is your program, and "g++" is the c++ compiler. * * These are the routines that are provided: * void initgraphics(); - Call this once before calling anything else. * int getmaxx(); - returns maximum x coordinate of the window that's created. * int getmaxy(); - returns maximum y coordinate of the window that's created. * int maxpage(); - returns the highest page number for different graphics * pages, starting at zero. In this * implementation, the highest page number will always be 0 or 1. * void setvisualpage(int pagenumber); -- sets visual page to given page * number. * void setactivepage(int pagenumber); -- sets activepage for drawing. * void setcolor(int linecolor); -- sets color for drawing lines, pixels, and * the border of polygons. Colors are currently selected from: * 0 = black, 1 = white * void setfill(int fillcolor); -- sets the color for filling polygons. * void line(x1,y1,x2,y2); - draws a line from (x1,y1) to (x2,y2); * void plot(x,y); - plots a point at location x,y * void fillpoly(int numpoints, short polypoints[]); * Polypoints is an array of 2*numpoints shorts, giving the x- and y-pixel * coordinates of a polygon which will be drawn. * void drawpoly(int numpoints, short polypoints[]); -- draws unfilled polygon. * void clearviewport(); - clears the currently active window. * void updateall(); - Updates the screen to reflect past calls; i.e., this * flushes the output buffer. * void closegraph(); - Call this once when you're all done. ****************************************************************************/ void initgraphics(); int getmaxx(); int getmaxy(); int maxpage(); void setvisualpage(int pagenumber); void setactivepage(int pagenumber); void setcolor(int linecolor); void setfill(int fillcolor); void line(int x1, int y1, int x2, int y2); void plot(int x, int y); void fillpoly(int numpoints, short polypoints[]); void drawpoly(int numpoints, short polypoints[]); void clearviewport(); void closegraph(); void updateall();