home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / WGT_TC21.ZIP / WGT06.C < prev    next >
C/C++ Source or Header  |  1992-07-17  |  1KB  |  53 lines

  1. #include <conio.h>
  2. #include "c:\tc\wgt\wgt.h"
  3. /*   WORDUP Graphic Toolkit   Version 2.1
  4.      Demonstration program 6
  5.  
  6. Draws vertical lines of different colours, waits for a key, then
  7. fades the colours in and out.
  8.  
  9. */
  10.  
  11. int x,y,col;
  12. color palette[255];
  13.  
  14.  
  15. void main(void)
  16. {
  17. vga256();        // initializes system
  18.  
  19. for (y=0; y<64; y++)        
  20.    wsetrgb(y,y,y,y,&palette);       // sets first 64 colours to grey
  21.                     // note the use of &
  22. for (y=0; y<64; y++)
  23.    wsetrgb(y+64,y,0,0,&palette);        // next 64 to red
  24. for (y=0; y<64; y++)
  25.    wsetrgb(y+128,0,y,0,&palette);       // green
  26. for (y=0; y<64; y++)
  27.    wsetrgb(y+192,0,0,y,&palette);    // blue
  28. wsetpalette(0,255,palette);        // and finally change them
  29.                     // all at once
  30.  
  31. for (y=0; y<200; y++)            // draw lines down the screen
  32.    {
  33.    wsetcolor(y);
  34.    wline(0,y,319,y);
  35.    }
  36.  
  37. getch();
  38. wfade_out(0,255,40,palette);
  39. delay(1000);
  40. wfade_in(1,255,40,palette);
  41. wfade_out(25,50,0,palette);
  42. wfade_out(50,75,0,palette);
  43. wfade_out(75,100,0,palette);
  44. wfade_out(100,125,0,palette);
  45. wfade_out(125,150,0,palette);
  46. wfade_out(150,175,0,palette);
  47. wfade_out(175,200,0,palette);
  48.  
  49. getch();        // get the key
  50.  
  51.  
  52. textmode(C80);        // used to return to text mode
  53. }