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

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. void main()
  8. {
  9.    char bitmap1[32], bitmap2[32];
  10.    int old_mode, new_mode;
  11.  
  12.    fg_initpm();
  13.    new_mode = fg_bestmode(320,200,1);
  14.    if (new_mode < 0 || new_mode == 12)
  15.    {
  16.       printf("This program requires a 320 ");
  17.       printf("x 200 color graphics mode.\n");
  18.       exit(1);
  19.    }
  20.  
  21.    old_mode = fg_getmode();
  22.    fg_setmode(new_mode);
  23.  
  24.    fg_setcolor(7);
  25.    fg_rect(0,31,0,7);
  26.    fg_setcolor(9);
  27.    fg_text("text",4);
  28.    fg_waitkey();
  29.  
  30.    fg_move(0,7);
  31.    fg_setcolor(7);
  32.    fg_getmap(bitmap1,4,8);
  33.    fg_setcolor(9);
  34.    fg_getmap(bitmap2,4,8);
  35.  
  36.    fg_move(4,15);
  37.    fg_setcolor(7);
  38.    fg_drawmap(bitmap1,4,8);
  39.    fg_setcolor(9);
  40.    fg_drawmap(bitmap2,4,8);
  41.    fg_waitkey();
  42.  
  43.    fg_setmode(old_mode);
  44.    fg_reset();
  45. }
  46.