Re: [AD] Color convertors

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


> So if the color convertors support any widths, we can skip this
> intermediate step?

No, because the windowed driver knows that it is being overlapped but
doesn't know which portion of the window is really hidden by another window.
Windows (like X11) only sends 'paint' events ('expose' events for X11) to
applications when a portion of the window that was previously hidden is
visible again, not the opposite. So if the app updates a portion of the
window that is under the overlapping window, the driver doesn't know that it
must not draw onto the window. There is no other way than using the
intermediate bitmap and asking the system to do the clipping.
But there is virtually no performance loss when the window is in the
foreground.

> Can we catch this event?

Yes, the system sends it to every running app.

> How hard would it be to switch the color convertor?

Not very hard I think.

> I understand there might be multi-threading issues, since the color
> convertor might be running while the screen mode changes.

Yes, we need to stop every drawing operation during the change.

> Can the color convertors run in a seperate (somehow syncronized) thread,
> which can be terminated upon desktop resolution change?

Not necessary, because we have already two threads: the main thread which
draws onto the screen and performs the color conversion and the window event
loop thread. When the latter catches the 'color depth switch' event, it
could take the graphics mutex, which automatically halts every drawing
operation for the other threads, instruct the windowed driver to change the
color convertor and then release the mutex when it is done. However this is
only a rough sketch and as always... the devil is in the details.

> IMO changing desktop resolution should be supported in Allegro 4 without
> crashing the Allegro program (or terminating it). It's part of a well
> behaved windowed program.

I would agree, but so far no user requested it (afaik) and this will require
a major rewrite of the three windowed drivers (windowed, overlay and GDI).

> Besides, how many programs do you know that close themselves when the
> destop rez changes?

Then we will keep the pretty nice crash ;-)

---
Eric Botcazou
ebotcazou@xxxxxxxxxx



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