home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 12 / CD_ASCQ_12_0294.iso / maj / 4401 / exc.arj / FGDOC / EXAMPLES / C / 10-09.C < prev    next >
Text File  |  1994-01-24  |  932b  |  48 lines

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. char arrow[] = {
  8.    0x00,0x00,0x00,0xF0,0x00,
  9.    0x00,0x00,0x00,0xFF,0x00,
  10.    0xFF,0xFF,0xFF,0xFF,0xF0,
  11.    0xFF,0xFF,0xFF,0xFF,0xFF,
  12.    0xFF,0xFF,0xFF,0xFF,0xF0,
  13.    0x00,0x00,0x00,0xFF,0x00,
  14.    0x00,0x00,0x00,0xF0,0x00
  15.    };
  16.  
  17. void main()
  18. {
  19.    int old_mode;
  20.  
  21.    if (fg_testmode(13,1) == 0) {
  22.       printf("This program requires a 320 ");
  23.       printf("x 200 EGA graphics mode.\n");
  24.       exit(1);
  25.       }
  26.  
  27.    old_mode = fg_getmode();
  28.    fg_setmode(13);
  29.    fg_setcolor(1);
  30.    fg_fillpage();
  31.    fg_setclip(0,15,0,199);
  32.  
  33.    fg_move(10,10);
  34.    fg_drwimage(arrow,5,7);
  35.    fg_move(10,20);
  36.    fg_clpimage(arrow,5,7);
  37.    fg_move(8,30);
  38.    fg_revimage(arrow,5,7);
  39.    fg_move(8,40);
  40.    fg_flpimage(arrow,5,7);
  41.    fg_move(8,50);
  42.    fg_putimage(arrow,5,7);
  43.    fg_waitkey();
  44.  
  45.    fg_setmode(old_mode);
  46.    fg_reset();
  47. }
  48.