Re: [AD] Improvements to the graphics drivers

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


On 2009-10-10, Paul Suntsov <siegelords_abode@xxxxxxxxxx> wrote:
> 
> Here's the API for it:
> 
> ALLEGRO_ATLAS* al_create_atlas(int width); 
> 
> Creates an atlas, all atlases are square (makes little point of
> creating a non-square atlast on POT-only GPU's)
> 
> void al_destroy_atlas();
> 
> Destroys the atlas and the bitmap, taking all the sub-bitmaps with it.

Requires a parameter, of course.

> bool al_add_bitmap_to_atlas(ALLEGRO_ATLAS* atlas, ALLEGRO_BITMAP* bmp);
> 
> Attempts to add a bitmap to the atlas. Returns true on success, false
> on failure (bitmap bigger than the estimated empty space). If
> successful, the passed bitmap becomes a sub-bitmap of the atlas.

I don't think you want to modify the bitmap like that.  Due to
"sub-classing" ALLEGRO_BITMAPs can have different sizes.

> ALLEGRO_BITMAP* al_convert_atlas_to_bitmap(ALLEGRO_ATLAS* atlas);
> 
> Converts the atlas to just a bitmap and destroys the atlas. This is a
> memory saving operation, since most likely the atlasing algorithm will
> be using a rather sizeable tree, which games (especially those on
> mobile devices) probably don't want to lug around. Maybe unnecessary.
> Perhaps just have a al_finalize_atlas() that just deletes that tree,
> but keeps the atlas around.

al_finalize_atlas() makes more sense.  You wouldn't be able to do much
with the returned bitmap other than destroying it.  Although, drawing it
or saving it to disk could be useful for debugging but you might want to
add
    ALLEGRO_BITMAP *al_get_bitmap_from_atlas(ALLEGRO_ATLAS *atlas);
instead.

> 3. ALLEGRO_TRANSFORM in the allegro core
> 
> This simplifies the deferred drawing implementation, and is overall
> desirable by some people. No new API, just making the implementation
> work for all drawing operations. This is easy for hardware stuff, not
> quite as much for the software stuff, but is still doable. For fonts
> I'd suggest not doing anything special, and just stretching the
> glyphs. Todd Cope said that this looks acceptable with GL_LINEAR
> turned on.
> 
> So any ideas/thoughts/suggestions?

Go for it :)

Peter




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