Re: [AD] Meaning of the texture coordinates for the primitives addon

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


On Mon, 2009-09-07 at 14:09 +1000, Peter Wang wrote:
> True.  I guess I would have made each tile a separate bitmap or
> sub-bitmap.

Hm, sub-bitmaps are another case where coordinates are specified. But
those really should always be pixels.

> > 
> > And looking at the code, there actually seems to be little justification
> > to not simply make the clipping rectangle a bitmap property. The only
> > place right now where this is not the case already is in
> > al_set_target_bitmap - which resets it to cover the whole bitmap, which
> > is a somewhat questionable feature anyway.
> 
> Can you explain more?  I wasn't aware of this feature, whatever it is.

al_set_target_bitmap(A);
al_set_clipping_rectangle(10, 10, 20, 20);
al_set_target_bitmap(A);
al_line(0, 0, 100, 100, red);

Right now, the implementation and behavior of clipping disagree a bit on
how this should work. The clipping rectangle is stored in
ALLEGRO_BITMAP, which suggests the line above should get clipped.
However, al_set_target_bitmap always reset clipping, so the line does
not get clipped. If that's the desired behavior, it would make more
sense to store the clipping rectangle in TLS, implementation-wise.

> 
> I might have asked this already. If the transformation includes a
> rotation, will al_draw_bitmap() rotate the source image?
> 
> That probably would mean the font addons could draw rotated text
> without any extra work.

True. As I said, I think it even already works, because
al_use_transformation modifies the OpenGL matrix stack.





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