home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / fgl / fglight / exc.arj / TEMP / 10-12.C < prev    next >
Text File  |  1995-01-20  |  757b  |  41 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 bitmap[256];
  10.    int old_mode, new_mode;
  11.    int width;
  12.  
  13.    fg_initpm();
  14.    new_mode = fg_bestmode(320,200,1);
  15.    if (new_mode < 0 || new_mode == 12)
  16.    {
  17.       printf("This program requires a 320 ");
  18.       printf("x 200 color graphics mode.\n");
  19.       exit(1);
  20.    }
  21.  
  22.    old_mode = fg_getmode();
  23.    fg_setmode(new_mode);
  24.    width = (int)fg_imagesiz(32,1);
  25.  
  26.    fg_setcolor(7);
  27.    fg_rect(0,31,0,7);
  28.    fg_setcolor(9);
  29.    fg_text("text",4);
  30.    fg_waitkey();
  31.  
  32.    fg_move(0,7);
  33.    fg_getimage(bitmap,width,8);
  34.    fg_move(4,15);
  35.    fg_drwimage(bitmap,width,8);
  36.    fg_waitkey();
  37.  
  38.    fg_setmode(old_mode);
  39.    fg_reset();
  40. }
  41.