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 >
Wrap
Text File
|
1992-07-16
|
2KB
|
40 lines
WordUp Graphics Toolkit
-----------------------
Important Features:
Graphics Pages
--------------
Some video modes allow users to set a visual and an active page. This
means that while the user watches one screen, the computer can be drawing on
another. Many animation sequences are created by flipping from page to page.
Unfortunately, the 320*200*256 mode does not support these pages. The WGT does
however provide a 'False' version of these pages. Our active page may change,
but the visual page is always set.
We use the wnewblock to allocate memory for a different screen of
memory to be used. The screen is referenced by a pointer. This allows us to
create and remove screens of memory, but how do we select them for use?
Two procedures are utilized to make paging easy. The first sets the active page
back to the visual (normal) page. This command is called wnormscreen.
The second is set by the program to tell WGT which screen to draw on. This one
is called wsetscreen.
The following program segment will initialize a virtual screen,
draw a circle on that screen, copy the entire screen to the visual screen,
and then draw a box on the visual screen.
second=wnewblock(0,0,319,199) // gets a whole screen (320x200)
wsetscreen(second);
wcircle(100,100,40);
wcopyscreen(0,0,319,199,second,0,0,NULL);
wnormscreen();
wbox(10,40,150,90);
Notice that wcopyscreen uses NULL as the visual page. Copying is not limited to
the visual screen. Parts of a second screen could be copied to a third or
fourth or even the same screen.
The final result must always be copied to the visual to be seen.