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

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. char triangle[] =
  8. {
  9.    1,9, 7,1, 1,1, 2,5, 1,1, 7,3, 1,1, 2,3,
  10.    1,1, 7,5, 1,1, 2,1, 1,1, 7,7, 1,1, 7,4
  11. };
  12.  
  13. void main()
  14. {
  15.    int old_mode, new_mode;
  16.  
  17.    fg_initpm();
  18.    new_mode = fg_bestmode(320,200,1);
  19.    if (new_mode < 0 || new_mode == 12)
  20.    {
  21.       printf("This program requires a 320 ");
  22.       printf("x 200 color graphics mode.\n");
  23.       exit(1);
  24.    }
  25.  
  26.    old_mode = fg_getmode();
  27.    fg_setmode(new_mode);
  28.  
  29.    fg_setcolor(7);
  30.    fg_rect(0,319,0,199);
  31.  
  32.    fg_move(156,101);
  33.    fg_display(triangle,16,9);
  34.    fg_waitkey();
  35.  
  36.    fg_setmode(old_mode);
  37.    fg_reset();
  38. }
  39.