home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / w / wgt3_ex.zip / WGT10.C < prev    next >
C/C++ Source or Header  |  1992-09-08  |  2KB  |  64 lines

  1. #include <conio.h>
  2. #include <wgt.h>
  3. /*   WORDUP Graphics Toolkit   Version 3.0
  4.      Demonstration program 10
  5.  
  6. Shows the difference between normal and xray putblock modes
  7. and demonstrates the flipblock procedure.
  8.  
  9. */
  10.  
  11. int i,x,y;
  12. color palette[256];
  13. block part1;            // part of the screen
  14.  
  15.  
  16. void main(void)
  17. {
  18. vga256();        // initializes system
  19.  
  20.  
  21. for (y=1; y<64; y++)        
  22.    wsetrgb(y,y,y,y,&palette);       // sets first 64 colours to grey
  23.                     // note the use of &
  24. for (y=0; y<64; y++)
  25.    wsetrgb(y+64,y,0,0,&palette);        // next 64 to red
  26. for (y=0; y<64; y++)
  27.    wsetrgb(y+128,0,y,0,&palette);       // green
  28. for (y=0; y<64; y++)
  29.    wsetrgb(y+192,0,0,y,&palette);    // blue
  30.  
  31.    wsetrgb(1,63,63,63,&palette);       // sets color 1 to white
  32.  wsetpalette(0,255,palette);        // and finally change them
  33.                     // all at once
  34.  
  35. for (y=40; y>=4; y--)
  36.   {
  37.   wfill_circle(y+40,y+10,y);            // draw a pattern
  38.   wsetcolor(y+20);
  39.   }
  40. part1=wnewblock(0,0,160,100);    // get the circle in a block
  41. wcls(0);            // clear the screen
  42. for (x=0; x<320; x++)
  43.   {
  44.   wsetcolor(x);
  45.   wline(x,0,x,199);
  46.   }
  47.  
  48. getch();
  49.   wputblock(160,0,part1,0);        // normal mode
  50.   wflipblock(part1,vertical);
  51. getch();
  52.   wputblock(160,100,part1,1);        // XRAY mode
  53.   wflipblock(part1,horizontal);
  54. getch();
  55.   wputblock(0,100,part1,0);        // normal mode
  56.   wflipblock(part1,vertical);
  57. getch();
  58.   wputblock(0,0,part1,1);        // XRAY mode
  59.   
  60.  
  61. getch();                // get the key
  62. wfreeblock(part1);
  63. textmode(C80);                // used to return to text mode
  64. }