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

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


On Mon September 7 2009, Elias Pschernig wrote:
> 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.
>

My only beef with that is keeping the clipping state when changing to a bitmap 
of a different size really doesn't make sense.

My suggested option is to keep the state in the bitmap itself, and just not 
reset it when switching the target bitmap.

What will OpenGL do when you switch the FBO and start drawing? Does it keep 
all of its state? Or do you have to reset all of the rendering state?

> > 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.
> 
> 
> ---------------------------------------------------------------------------
> --- Let Crystal Reports handle the reporting - Free Crystal Reports 2008
>  30-Day trial. Simplify your report design, integration and deployment -
>  and focus on what you do best, core application coding. Discover what's
>  new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> 


-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




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