home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / msdos / c / fglc / 06-07.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-30  |  657 b   |  36 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 x[] = {200,300,400,400,300,240,160,160,200,210};
  10. int y[] = {100, 80,100,220,320,320,240,200,160,150};
  11.  
  12. void main()
  13. {
  14.    int old_mode;
  15.    register int i;
  16.  
  17.    old_mode = fg_getmode();
  18.  
  19.    if (fg_testmode(16,1))
  20.       fg_setmode(16);
  21.    else if (fg_testmode(15,1))
  22.       fg_setmode(15);
  23.    else {
  24.       printf("This program requires a 640 x 350 ");
  25.       printf("EGA graphics mode.\n");
  26.       exit(1);
  27.       }
  28.  
  29.    fg_setcolor(1);
  30.    fg_polygon(x,y,VERTICES);
  31.    fg_waitkey();
  32.  
  33.    fg_setmode(old_mode);
  34.    fg_reset();
  35. }
  36.