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

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