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 / WGT21.C < prev    next >
C/C++ Source or Header  |  1992-09-08  |  908b  |  57 lines

  1. #include <conio.h>
  2. #include <stdio.h>
  3. #include <wgt.h>
  4.  
  5. /*   WORDUP Graphics Toolkit   Version 3.0
  6.      Demonstration program 21
  7.  
  8.     Shows off some special FX using wvertres.
  9.  
  10. */
  11.  
  12. void crush(block,block,int);
  13.  
  14. block screen1,screen2;        // two virtual screens
  15.  
  16. int y,s;
  17. color palette[256];
  18.  
  19. void main(void)
  20. {
  21. vga256();        // initializes system
  22. screen1=wloadblock("wgt1.blk");
  23. screen2=wloadblock("wgt2.blk");
  24. wloadpalette("wgt1.pal",&palette);
  25. wsetpalette(0,255,&palette);
  26.  
  27.   wputblock(0,0,screen1,0);
  28. do {
  29.   crush(screen1,screen2,5);
  30.   crush(screen2,screen1,5);
  31.   } while (!kbhit());
  32.  
  33.  
  34.  
  35. wfreeblock(screen1);    // remember to free that memory
  36. wfreeblock(screen2);
  37. textmode(C80);                // used to return to text mode
  38. }
  39.  
  40.  
  41. void crush(block b1, block b2, int dir)
  42. {
  43. int q,w,e;
  44.  
  45. for (q=199; q>=0; q-=dir)
  46.   {
  47.   wvertres(0,0,q,b1);
  48.   wvertres(0,q,199,b2);
  49.   }
  50.  
  51. }
  52.  
  53.  
  54.  
  55.  
  56.  
  57.