This is a list of all the procedure calls for gpc's graphics.  If you would like to use this graphics library with the NeXT C compiler, talk with Mike Tie (CMC 305). 

arc (radius, startdegree, finishdegree, direction : integer);

This command draws an arc, or a partial circle, of the specified radius. The arc begins at the specified angle startdegree, which is in degrees, and ends at the angle finishdegree. The direction is specified by a 1 or a 0. If direction = 1, then the arc is drawn counterclockwise. If direction = 0, then the arc is drawn clockwise. The partial circle's center is the current screen pointer.
circle (x, y, radius : integer);
This draws a circle centered at the point (x,y) with the supplied radius
circlefilled (x, y, radius : integer);
This draws a filled circle centered at the point (x,y) with the supplied radius. The circle is filled with the last color selected with setrgbcolor(red,green,blue).
cls;
Floods the current window with white.
closepicture;
Ends a set of graphics commands forming a shape's outline so you can fill them. See also newpicture and fill.
closewindow;
closes the current graphics window; if you want to continue drawing then you must open another window with createwindow.
createwindow (xmin, ymin, xmax, ymax : integer);
opens a window on the screen (assuming initializegraphics was called) with lower-left corner at (xmin,ymin) and upper-right corner at (xmax,ymax)
curve (x0,y0,x1,y1,xc0,yc0,xc1,yc1 : integer);
draws a Bezier curve from point (x0,y0) to (x1,y1) contolled by the points (xc0,yc0) and (xc1,yc1).
curveto (x,y,xc0,yc0,xc1,yc1 : integer);
draws a Bezier curve from the current screen position to (x,y) using (xc0,yc0) and (xc1,yc1) to control the curve.
displaytextxy (x,y: integer; text : string);
Pascal programmers only! C programmers should use showtext and showtextxy. Displays a string on the screen in the current font at the current screen pointer. setfont must be called prior to calling this function.
displaytext(text : string);
Pascal programmers only! Same as above, except it prints out the string at coordinate (x,y) instead of the current screen pointer.
drawpoly (numpoint : integer; polypoints : polyarray);
draws a polygon of NUMPOINT vertices, with the coordinates in the array POLYPOINTS. For pascal programmers, you must pass an array of type POLYARRAY, which is predefined, and can hold up to 100 points. C programmers can pass an array of struct graphpoint. The definition of polarray is included at the end of this document.
drawpolyfilled (numpoint : integer; polypoints : polyarray);
draws a polygon just like drawpoly does, and then fills it with the current color.
fill;
fills a shape's outline with the current color, assuming the object's defining graphics commands are bookended with a newpicture and a closepicture call.
flushgraphics;
draws all graphics commands on the screen which have not been flushed to the screen. all other graphics calls are drawn on a virtual screen, and they are dumped to the actual display with the flushgraphics command.
getx;
returns the current x-coordinate of the screen pointer
gety;
returns the current y-coordinate of the screen pointer
line (x0,y0,x1,y1 : integer);
draws a line in the current color from the point (x0,y0) to (x1,y1)
lineto (x,y : integer);
draws a line in the current color from the current screen position to thepoint (x,y)
move (x,y : integer);
moves the current screen pointer/position to the point (x,y)
movewindow;
Attaches lower left hand corner of current window to mouse pointer, moving the window with the pointer until the user presses the left mouse button, freezing the window in the current position.
moveto (x,y : integer);
moves the current screen pointer/postion to the point (x,y)
newpicture;
if you want to draw and fill a complicated object, i.e. a pie slice, which combines several diffent primitive call, usually arc, curve, or line, you need to tell the computer that the calls will be considered one object. you do this by first calling newpicture, then calling your primitives to draw the object, and then call closepicture. you can then call fill to fill the object. also see fill and closepicture.
rectangle (x0,y0,x1,y1 : integer);
draws a rectangle with lower-left coordinates (x0,y0) and upper-right coordinates (x1,y1)
rectanglefilled (x0,y0,x1,y1 : integer);
draws a rectangle filled with the current pen color with lower-left coordinates (x0,y0) and upper-right coordinates (x1,y1)
rlineto (xc,yc : integer);
draws a line from the current position to (currentx +xc, currenty +yc) using the parameters xc and yc as relative offsets from the current screen position rather than as absolute screen coordinates. (Note that this is different than lineto, which considers its parameters as absolute, rather than relative, coordinates.)
rmoveto (xc,yc : integer);
moves the current screen pointer by to relative coordinates (xc, yc). (That is, it adds xc to the current x coordinate of the screen pointer and adding yc to the current y coordinate of the screen coordinate.)
rotateaxes (degrees : integer);
the screen starts with standard-oriented axes. This command will rotate the axes by the amount in parameter degrees. All primitives will be drawn on the screen as with respect to these rotated axes, but the objects drawn previous to the rotateaxes are not rotated. Note that moveto and getx/gety will return pointer coordinates relative to these rotated axes, not in absolute terms of the screen.
scaleaxes (sx,sy : real);
this will scale the length of the axes, bloating or shrinking one or both of the dimensions. For example, if you call scaleaxes(2,1) and draw a circle, it will look like an ellipse since the axes are scaled.
note to C programmers: sx and sy are of type double.
setfont (fontnum, pointsize : integer);
sets the font that will be displayed on the screen by showtext. The pointsize parameter sizes the font, and fontnum switches font styles. Here are the numbers corresponding to the fonts:
Num Font Type
0 Times-Roman
1 Times-Roman Bold
2 Times-Roman Italic
3 Times-Roman Bold and Italic
4 Courier
5 Ohlfs
6 Symbol
7 Helvetica
setfont must be called before any calls to showtext, or the computer will complain with an obscure postscript error.
setlinewidth (width : integer);
sets the width of the lines that will be displayed with the line-drawing functions rlineto, lineto, and line.
setrgbcolor (red,green,blue : real);
sets the current color for drawn objects on the screen. Red, green, and blue are of type real, and you specify a number between 0.0 and 1.0 for each to tell the computer how much red, green, or blue you want in the color.
void showtext(char *text)
C programmers only! Pascal programmers should use showtext and showtextxy. Displays a string on the screen in the current font at the current screen pointer. setfont must be called prior to calling this function.
void showtextXY(int x, int y, char *text)
C programmers only! Same as above, except it prints out the string at coordinate (x,y) instead of the current screen pointer.
translateaxes(x,y : integer);
moves the axes from their current center to a center at (x,y).
-------------------------------------------------------- New Types for use with GPC: float = __short__ real; graphpoint = record x : integer; y : integer; end; polyarray = array[1..100] of graphpoint; graphics_string = packed array[1..200] of char;