home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / fgl / fglight / exc.arj / TEMP / 03-07.C < prev    next >
Text File  |  1995-01-20  |  583b  |  34 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.    fg_initpm();
  14.    old_mode = fg_getmode();
  15.    new_mode = fg_bestmode(320,200,1);
  16.  
  17.    if (new_mode < 0)
  18.    {
  19.       printf("This program requires a 320 by 200 graphics mode.\n");
  20.       exit(1);
  21.    }
  22.  
  23.    fg_setmode(new_mode);
  24.  
  25.    fg_setcolor(15);
  26.    fg_text("I'm running in mode ",20);
  27.    sprintf(string,"%d.",new_mode);
  28.    fg_text(string,3);
  29.    fg_waitkey();
  30.  
  31.    fg_setmode(old_mode);
  32.    fg_reset();
  33. }
  34.