Re: [AD] Rebuilding the screen |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Jason Wilkins <fenix@xxxxxxxxxx> writes:
> > I built Allegro 3.9.22 for MSVC and tested the grabber. When I Alt-Tab to
> > another application and switch back afterwards, the Grabber does not
> > redraw it's GUI-Objects.
>
> This is because no one has implemented lost-bitmap callbacks in the
> grabber yet.
>
> Idea: Why not have the GUI objects automatically detect that they need to
> be redrawn when the bitmap they are being drawn to is lost? I have not
> investigated whether this would work, or would be efficient. Perhaps a
> new GUI message?
I think you can just make the dialog manager send a redraw message when it
detects this. That should certainly be done.
But unfortunately, it isn't a full solution to the problem. Many (most?)
Allegro programs make a basic assumption that the screen contents are
persistent, and often don't have enough state information to regenerate the
entire display on demand. A quick hack to the dialog manager would make the
grabber handle this correctly when it is sat there doing nothing in
particular, but you'd still get interesting effects if the switch occured
while you were displaying the file selector, navigating a popup menu, or
selecting an image region to grab. The library can't fix these things for
you, because it requires a basic change to the way programs are written, and
that can only be done on a per-program basis. I don't personally care enough
about this to go to all the trouble of rewriting the grabber, and even if I
did, there would still be problems with the test program, demo game, etc :-)
Losing the screen contents are no problem with games that redraw the whole
screen on every frame, or at least have the ability to do so on demand (ie.
most realtime animation systems), and they are no problem with a true GUI
system like Windows, GEM, X, or whatever. But unfortunately, this just
doesn't mix well with the way that most Allegro user interface code is
written.
--
Shawn Hargreaves - shawn@xxxxxxxxxx - http://www.talula.demon.co.uk/
"A binary is barely software: it's more like hardware on a floppy disk."