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

  1. #include <fastgraf.h>
  2. #include <io.h>
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5.  
  6. void main(void);
  7.  
  8. #ifdef FG32
  9. char buffer[20000];
  10. #else
  11. char far buffer[20000];
  12. #endif
  13.  
  14. void main()
  15. {
  16.    int file_size;
  17.    int old_mode;
  18.    FILE *stream;
  19.  
  20.    fg_initpm();
  21.    if (fg_testmode(19,1) == 0)
  22.    {
  23.       printf("This program requires a 320 ");
  24.       printf("x 200 MCGA graphics mode.\n");
  25.       exit(1);
  26.    }
  27.  
  28.    stream = fopen("CORAL.PCX","rb");
  29.    file_size = (int)(filelength(fileno(stream)));
  30.    fread(buffer,1,file_size,stream);
  31.    fclose(stream);
  32.  
  33.    old_mode = fg_getmode();
  34.    fg_setmode(19);
  35.  
  36.    fg_imagebuf(buffer,file_size);
  37.    fg_showpcx("",4);
  38.    fg_waitkey();
  39.  
  40.    fg_setmode(old_mode);
  41.    fg_reset();
  42. }
  43.