home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / WGT_TC21.ZIP / VIRTUAL.DOC < prev    next >
Text File  |  1992-07-16  |  2KB  |  40 lines

  1. WordUp Graphics Toolkit
  2. -----------------------
  3.  
  4. Important Features:
  5.  
  6. Graphics Pages
  7. --------------
  8.  
  9.     Some video modes allow users to set a visual and an active page. This
  10. means that while the user watches one screen, the computer can be drawing on
  11. another. Many animation sequences are created by flipping from page to page.
  12. Unfortunately, the 320*200*256 mode does not support these pages. The WGT does
  13. however provide a 'False' version of these pages. Our active page may change,
  14. but the visual page is always set.
  15.  
  16.     We use the wnewblock to allocate memory for a different screen of
  17. memory to be used. The screen is referenced by a pointer. This allows us to
  18. create and remove screens of memory, but how do we select them for use?
  19. Two procedures are utilized to make paging easy. The first sets the active page
  20. back to the visual (normal) page.  This command is called wnormscreen.
  21. The second is set by the program to tell WGT which screen to draw on. This one
  22. is called wsetscreen.
  23.  
  24.     The following program segment will initialize a virtual screen,
  25. draw a circle on that screen, copy the entire screen to the visual screen,
  26. and then draw a box on the visual screen.
  27.  
  28.     second=wnewblock(0,0,319,199)    // gets a whole screen (320x200)
  29.     wsetscreen(second);
  30.     wcircle(100,100,40);
  31.     wcopyscreen(0,0,319,199,second,0,0,NULL);
  32.     wnormscreen();
  33.     wbox(10,40,150,90);
  34.  
  35. Notice that wcopyscreen uses NULL as the visual page. Copying is not limited to
  36. the visual screen. Parts of a second screen could be copied to a third or
  37. fourth or even the same screen.
  38. The final result must always be copied to the visual to be seen.
  39.  
  40.