home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / fgl / fglight / exc.arj / TEMP / 10-21.C < prev    next >
Text File  |  1995-01-20  |  692b  |  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.    0x17,9,1, 0x12,1,5, 0x17,1,3, 0x12,1,3,
  10.    0x17,1,5, 0x12,1,1, 0x17,1,7, 0x17,1,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_displayp(triangle,16,9);
  34.    fg_waitkey();
  35.  
  36.    fg_setmode(old_mode);
  37.    fg_reset();
  38. }
  39.