[Contents] [index] [Help] [Retrace] [browse <] [Browse >]

You can use multiple draw() statements to draw connected line figures. if
the shapes are all definable as interconnected, continuous lines, you can
use a simpler function, called polydraw(). polydraw() takes a set of line
endpoints and draws a shape using these points. You call PolyDraw() with
the statement:

    PolyDraw(&rastPort, count, arraypointer);

polydraw() reads the array of points and draws a line from the first pair
of coordinates to the second, then a connecting line to each succeeding
pair in the array until count points have been connected. This function
uses the current drawing mode, pens, line pattern, and write mask
specified in the target rastport; for example, this fragment draws a
rectangle, using the five defined pairs of x,y coordinates.

    SHORT linearray[] =
        {
         3, 3,
        15, 3,
        15,15,
         3,15,
         3, 3
        };

    PolyDraw(&rastPort, 5, linearray);