Mail Archives: djgpp/1993/06/18/09:09:34
I have an application that currently works under TurboC and
have been trying to port it to djgpp. It's basically (right now)
for a pulldown menu that will read an initialization
file to change the items/options without recompiling. In other
words, it involves a lot of graphics and mouse input. But I digress...
My question is I need to save the background before drawing a
pulldown menu so that I can restore it when the pulldown menu
goes away. I used getimage() and putimage() in TurboC and couldn't
figure out how to do it since the Libgrx documentation is a little
thin on the subject. For example, my code looks something like:
draw_pulldown()
{
...
<figure out which pulldown to draw>
<determine the pulldown vertices - xleft, xright, ytop, ybottom>
save_backgrnd(xleft, ytop, xright, ybottom);
<drawing routines for pulldown>
...
}
// ...meanwhile, in another file
manage_mouse()
{
...
<need exists to erase the pulldown menu and restore original background>
restore_backgrnd();
...
}
The point being that the functions to save and restore the background
are seperate, and may be called at unpredicatable times from other
files. The way I do this now is to make the area saved a global pointer.
Does anybody have a small code fragment that does something similar
to this in Libgrx that I can look at. I assume I need to use GrBitBlt().
Thanks,
-Joe
***********************************************************************
* Joe Clark | Internet : joe AT ziggy DOT larc DOT nasa DOT gov *
* NASA Langley Research Center | *
* MS 152E | Phone : 804-864-6655 *
* Hampton, VA 23665 | FAX : 804-864-7793 *
***********************************************************************
- Raw text -