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

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. char perimeter[] = {0xFF,0x80,0x41,0x00,0x22,0x00,0x14,0x00,0x08,0x00};
  8. char interior[]  = {0x00,0x00,0x3E,0x00,0x1C,0x00,0x08,0x00,0x00,0x00};
  9.  
  10. void main()
  11. {
  12.    int old_mode, new_mode;
  13.  
  14.    fg_initpm();
  15.    new_mode = fg_bestmode(320,200,1);
  16.    if (new_mode < 0 || new_mode == 12)
  17.    {
  18.       printf("This program requires a 320 ");
  19.       printf("x 200 color graphics mode.\n");
  20.       exit(1);
  21.    }
  22.  
  23.    old_mode = fg_getmode();
  24.    fg_setmode(new_mode);
  25.  
  26.    fg_setcolor(7);
  27.    fg_rect(0,319,0,199);
  28.  
  29.    fg_move(156,101);
  30.    fg_setcolor(1);
  31.    fg_drawmap(perimeter,2,5);
  32.    fg_setcolor(2);
  33.    fg_drawmap(interior,2,5);
  34.    fg_waitkey();
  35.  
  36.    fg_setmode(old_mode);
  37.    fg_reset();
  38. }
  39.