Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_polygon() draw a polygon</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _polygon()              Draw a polygon

 #include   <graph.h>

 short _polygon(control, points numpoints);
 short control;                 Fill control: _GBORDER or _GFILLINTERIOR
 struct xycoord _far *points;   Data points (i.e. vertices)
 short numpoints;               Number of points (i.e. vertices)

    _polygon() draws a polygon on the screen, taking the numpoints
    points in the array points for the polygon's vertices. The polygon
    is drawn in the current color, and may be filled with the current
    fill pattern if control is set to _GFILLINTERIOR.

    Returns:    Nonzero value for success; 0 otherwise.

   Portability:     MS-DOS only, true MDPA, CGA, EGA, MCGA, or VGA video
                    compatibles

   -------------------------------- Example ---------------------------------

     This program puts a triangle on the screen.

    #include <conio.h>
    #include <stdlib.h>
    #include <graph.h>
    #include <stdlib.h>

    void main()
    {
        struct xycoord rver[3];
        _setvideomode(_MAXCOLORMODE);
        _setwritemode(_GPSET);

        rver[0].xcoord = 10;
        rver[0].ycoord = 10;
        rver[1].xcoord = 10;
        rver[1].ycoord = 50;
        rver[2].xcoord = 50;
        rver[2].ycoord = 50;
        _polygon(_GBORDER, rver, 3);

        getch();
        _setvideomode(_DEFAULTMODE);
    }

See Also: _floodfill() _lineto() _setcolor() _setfillmask() _setlinestyle()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson