home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Graphics / graphics-16000.iso / msdos / animutil / fastgfx / fg110c / 11-02.c < prev    next >
Text File  |  1992-01-30  |  664b  |  36 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 new_mode, old_mode;
  10.  
  11.    new_mode = fg_bestmode(320,200,2);
  12.    if (new_mode < 0 || new_mode == 12) {
  13.       printf("This program requires a 320 ");
  14.       printf("x 200 color graphics mode.\n");
  15.       exit(1);
  16.       }
  17.    old_mode = fg_getmode();
  18.    fg_setmode(new_mode);
  19.    fg_allocate(1);
  20.    fg_sethpage(1);
  21.  
  22.    fg_setcolor(2);
  23.    fg_rect(0,319,0,199);
  24.    fg_setpage(1);
  25.    fg_setcolor(1);
  26.    fg_rect(0,319,0,199);
  27.    fg_waitkey();
  28.  
  29.    fg_fadein(0);
  30.    fg_waitkey();
  31.  
  32.    fg_freepage(1);
  33.    fg_setmode(old_mode);
  34.    fg_reset();
  35. }
  36.