Prev Top Next

Name
KXL_DrawPolygon
Synopsis

    KXL_DrawPolygon -- A polygon is drawn.
    It clears by the color set up by KXL_SetDrawColor.

Description

    void KXL_DrawPolygon(KXL_Polygon polygon, Uint16 max, Bool position, Bool fill);

Arguments

polygon | Arrangement of a point.
max | Number of points.
position | True = Absolutely position. False = relative position from a front position.
fill | True = The inside of a polygon is applied. False = The inside of a polygon is not applied.

Return Value
Nothing.
Exsample

    #include <KXL.h>

    int main(void)
    {
      Sint16 i;
      KXL_Polygon p[4] = {
        {0, 0}, {20, 0}, {-10, 10}, {-10, -10}
      };

      KXL_CreateWindow(100, 100, "sample", 0);
      for (i = 0; i < 30; i ++) {
        KXL_SetDrawColor(rand() % 0xff, rand() % 0xff, rand() % 0xff);
        p[0].x = rand() % 80;
        p[0].y = rand() % 80;
        KXL_DrawPolygon(p, 4, False, True);
      }
      KXL_UpDateImm(0, 0, 100, 100);
      getchar();
      KXL_DeleteWindow();
      return 0;
    }