home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / fgl / fglight / exc.arj / TEMP / 06-08.C < prev    next >
Text File  |  1995-01-20  |  892b  |  46 lines

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. #define VERTICES 10
  8.  
  9. int xy[] = {200,100, 300, 80, 400,100, 400,220, 300,320,
  10.             240,320, 160,240, 160,200, 200,160, 210,150};
  11. int work_array[700];
  12.  
  13. void main()
  14. {
  15.    int old_mode;
  16.  
  17.    fg_initpm();
  18.    old_mode = fg_getmode();
  19.  
  20.    if (fg_testmode(16,1))
  21.       fg_setmode(16);
  22.    else if (fg_testmode(15,1))
  23.       fg_setmode(15);
  24.    else
  25.    {
  26.       printf("This program requires a 640 x 350 ");
  27.       printf("EGA graphics mode.\n");
  28.       exit(1);
  29.    }
  30.  
  31.    fg_setcolor(1);
  32.    fg_polyoff(-120,-25);
  33.    fg_polyline(xy,VERTICES);
  34.    fg_polyoff(200,-25);
  35.    fg_polyfill(xy,work_array,VERTICES);
  36.    fg_waitkey();
  37.  
  38.    fg_setcolor(2);
  39.    fg_setclip(480,639,175,349);
  40.    fg_polyfill(xy,work_array,VERTICES);
  41.    fg_waitkey();
  42.  
  43.    fg_setmode(old_mode);
  44.    fg_reset();
  45. }
  46.