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

  1. #include <fastgraf.h>
  2.  
  3. void main(void);
  4.  
  5. #define COLORS 16
  6. #define WIDTH  40
  7.  
  8. void main()
  9. {
  10.    int base;
  11.    int color;
  12.    int minx, maxx;
  13.    int mode;
  14.  
  15.    fg_initpm();
  16.    mode = fg_getmode();
  17.    fg_setmode(16);
  18.  
  19.    base = 0;
  20.    minx = 0;
  21.    maxx = WIDTH - 1;
  22.  
  23.    for (color = 0; color < COLORS; color++)
  24.    {
  25.       fg_palette(color,0);
  26.       fg_setcolor(color);
  27.       fg_rect(minx,maxx,0,349);
  28.       minx = maxx + 1;
  29.       maxx = maxx + WIDTH;
  30.    }
  31.  
  32.    while (base < COLORS*4)
  33.    {
  34.       for (color = 0; color < COLORS; color++)
  35.          fg_palette(color,base+color);
  36.       base += COLORS;
  37.       fg_waitkey();
  38.    }
  39.  
  40.    fg_setmode(mode);
  41.    fg_reset();
  42. }
  43.