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

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. void main()
  8. {
  9.    int old_mode;
  10.    int x;
  11.  
  12.    /* initialize the video environment */
  13.  
  14.    fg_initpm();
  15.    if (fg_testmode(13,1) == 0)
  16.    {
  17.       printf("This program requires EGA.\n");
  18.       exit(1);
  19.    }
  20.    old_mode = fg_getmode();
  21.    fg_setmode(13);
  22.    fg_setfunc(3);
  23.  
  24.    /* draw some type of background */
  25.  
  26.    fg_setcolor(15);
  27.    fg_rect(0,319,0,199);
  28.  
  29.    /* move the object across the screen */
  30.  
  31.    fg_setcolor(10^15);
  32.    for (x = -20; x < 320; x+=5)
  33.    {
  34.       fg_clprect(x,x+19,95,104);
  35.       fg_waitfor(1);
  36.       fg_clprect(x,x+19,95,104);
  37.    }
  38.  
  39.    /* restore the original video mode and return to DOS */
  40.  
  41.    fg_setmode(old_mode);
  42.    fg_reset();
  43. }
  44.