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

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


On 2009-08-26, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> On 2009-08-26, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> > On 2009-08-25, Elias Pschernig <elias.pschernig@xxxxxxxxxx> wrote:
> > > On Tue, 2009-08-25 at 16:52 +0200, Anders Andersson wrote:
> > > > I think it may be good to support both 0-1 and 0-bitmap_size. Why choose one?
> > > > 
> > > 
> > > Supporting both (but with default being pixels) doesn't sound bad. Maybe
> > > have an al_use_texture_transform function?
> > 
> > Well, my first reaction is that you'll end up with code using different
> > conventions, so now you have to know what convention is in effect when
> > reading/writing code and switching between them at runtime.
> 
> Actually, here's a counterproposal:
> 
> For the same reasons that you want parameterised (normalised) texture
> coordinates, al_draw_scaled_bitmap, al_draw_rotated_scaled_bitmap, etc.
> should take parameterised coordinates for the source bitmap.
> The destination coordinates would still in be pixel coordinates.

No takers?  Scaling a bitmap is obviously just a subset of texture
mapping, so I think this makes sense.  Most of the time you want to
scale the whole of a source bitmap, so it would be more convenient
to pass (0,0,1,1) instead of (0,0,sw,sh), too.

Peter




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