Re: [AD] Progress report on Linux console Allegro

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Jason Wilkins <fenix@xxxxxxxxxx> writes:
> My big question is, does the library cache the information from the screen
> bitmap anywhere

All over the place. Most obviously is if anybody makes a sub-bitmap of it, 
but also, it could well be in the middle of a drawing operation when the 
switch occurs, in which case all sorts of temporary pointers might be 
scattered around the stack, in registers, or whatever.

> the reason is that there is no guarantee that the screen bitmap will be at 
> the same address when you acquire it again later.

That's a problem. If you are very careful about keeping pointers to 
sub-bitmaps, and have some way to control exactly when the mode switch is 
allowed to take place, t is possible that you could get this working, but 
you will have a lot of things that need to be fixed up when it happens. If 
there is any way that it can switch away and move your screen from in the 
middle of a drawing call, you are completely screwed :-)

> I was going to make the behavior configurable as well, so it can either
> suspend when you switch, or just let it draw into a hidden buffer (which 
> is needed anyway to store the contents of the framebuffer during the
> switch).

There is already a nice system for handling this, that Marek put in his 
Linux code a year or so ago. Someone needs to look and see exactly how this 
works, and explain it to the rest of us...

> There is no reason to break out builds, just add the functions to the end
> of the structure and they will automagically be set to NULL. (am I wrong?)

I don't like doing that, though. Actually I tend to put functions earlier on 
in the structure, deliberately to make sure that I will get errors and be 
forced to fix everything.

> What exactly does the lost bitmap callback do?  Does it give you a chance
> to save the bitmap, or just to know that it was lost and it needs
> restoration?

It just tells you that it was lost. In Windows, there is no way to detect 
this before it happens. A truly dumb piece of OS design, but there you go. 
It sends the notification message _after_ it has already destroyed the 
framebuffer contents.


--
Shawn Hargreaves - shawn@xxxxxxxxxx - http://www.talula.demon.co.uk/
"A binary is barely software: it's more like hardware on a floppy disk."



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/