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

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