Re: [AD] per-thread transformation and blending mode

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




On 06/24/2010 09:49 AM, Peter Wang wrote:
Recall that I'm working on eliminating the "current display", as I
believe this makes the API much clearer.  Recall also that when you draw
something, the transformation/blending mode are taken from the current
display -- except when there is no current display, then the
transformation/blending mode come from the thread.  (I say "recall", but
I didn't really understand this that well before :)

Previously, you could almost ignore that.  Most of the time you only
have a single display, so targeting different video bitmaps wouldn't
change the current display, and hence the transformation/blending.
And when you target a memory bitmap nothing would change either because
the bitmap doesn't belong to any display.

If you replace the "current display" with the "currently targetted
display" (i.e. the display that owns the target bitmap), this scheme
leads to confusing behaviour.  When you target a video bitmap, you take
the transformation/blending from the target display.  But when you
target a memory bitmap, there is no target display, so the
transformation/blending has to be taken from thread-local state.

One solution is to roll back part of the change, so that when you target
a memory bitmap you still take the transformation/blending from the
previously targetted display.

But perhaps it would be clearer to make transformation/blending always
per-thread state?  Whatever bitmap you target, the settings that were
set in the current thread will apply, and it doesn't matter what display
the bitmap does or doesn't belong to.

Peter

I agree mostly... the thread-local and display-local divide is a little confusing, so cleaning it up like that would only simplify the situation for the user.

Do you have any plans for deferred drawing also? It's the other display-local feature other than transformations and blending.

-SiegeLord




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