home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Graphics / graphics-16000.iso / msdos / animutil / fastgfx / fg110c / 03-08.c < prev    next >
Text File  |  1992-01-30  |  565b  |  32 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 new_mode;
  11.    char string[4];
  12.  
  13.    old_mode = fg_getmode();
  14.    new_mode = fg_bestmode(320,200,1);
  15.  
  16.    if (new_mode < 0) {
  17.       printf("This program requires a 320 by 200 graphics mode.\n");
  18.       exit(1);
  19.       }
  20.  
  21.    fg_setmode(new_mode);
  22.  
  23.    fg_setcolor(15);
  24.    fg_text("I'm running in mode ",20);
  25.    sprintf(string,"%d.",new_mode);
  26.    fg_text(string,3);
  27.    fg_waitkey();
  28.  
  29.    fg_setmode(old_mode);
  30.    fg_reset();
  31. }
  32.