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

  1. #include <fastgraf.h>
  2.  
  3. #define WIDTH  20
  4. #define HEIGHT 20
  5.  
  6. void main(void);
  7.  
  8. #ifdef FG32
  9. char buffer[WIDTH*HEIGHT];
  10. #else
  11. char far buffer[WIDTH*HEIGHT];
  12. #endif
  13.  
  14. void main()
  15. {
  16.    int handle;
  17.    int old_mode;
  18.    int x;
  19.  
  20.    fg_initpm();
  21.    old_mode = fg_getmode();
  22.    fg_setmode(19);
  23.    fg_vbinit();
  24.  
  25.    fg_setcolor(15);
  26.    fg_rect(0,WIDTH-1,0,HEIGHT-1);
  27.    fg_setcolor(9);
  28.    fg_rect(1,WIDTH-2,1,HEIGHT-2);
  29.    fg_waitkey();
  30.  
  31.    handle = fg_vbdefine(buffer,WIDTH,HEIGHT);
  32.    fg_vbopen(handle);
  33.    fg_vbcut(0,WIDTH-1,0,HEIGHT-1,0,HEIGHT-1);
  34.  
  35.    for (x = 0; x <= 320-WIDTH; x += WIDTH)
  36.       fg_vbpaste(0,WIDTH-1,0,HEIGHT-1,x,199);
  37.    fg_waitkey();
  38.  
  39.    fg_vbclose();
  40.    fg_setmode(old_mode);
  41.    fg_reset();
  42. }
  43.