Re: [AD] power-of-two textures?

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


On 2008-02-11, Elias Pschernig <elias@xxxxxxxxxx> wrote:
> 
> On Tue, 2008-02-12 at 00:01 +1100, Peter Wang wrote:
> > Hi,
> > 
> > Apparently my old, old video card or its driver doesn't support
> > non-power-of-two textures, so the current X driver doesn't work.
> > 
> > What is the plan for Allegro to support such a limitation?  Do we just
> > need to modify ALLEGRO_BITMAP to hold the "actual" width and height
> > fields, and allocate extra space?  `al_lock_bitmap' would take that into
> > account when calculating the pitch.  What else needs to be done?
> 
> Yes. Basically, we need to do everything AllegroGL does (especially
> detection heuristics when we can and when can't use NPOT textures). I
> think one idea could be if we slightly change the bitmap API semantics
> so it is possible that al_create_bitmap returns a sub-bitmap.

Well, not really a sub-bitmap because destroying it will free the space for
it, unlike a true sub-bitmap.

> In this
> case, if a driver only allows POT textures (or knows that OpenGL will
> fall back to software mode for NPOT) it could create a POT bitmap, then
> return a sub-bitmap of that. As far as I can see, this should have no
> bad side effects.

Agreed.

> Another problem is maximum texture size. In theory, old drivers might
> have a limit as low as 256x256 - but I guess every normally we could
> expect at least 2048x2048. Still, if the user creates a 3000x500 bitmap,
> I don't think this should be allowed to fail. So in a similar way, my
> idea is to allow "composed bitmaps". Those are bitmaps consisting of
> multiple smaller ones.

How would al_lock_bitmap work on them?

Peter





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