Re: [AD] List of sub bitmaps

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


On Thu, May 10, 2012 at 7:08 AM, Trent Gamblin <trent@xxxxxxxxxx> wrote:
> Is there any reason why bitmaps can't have a list of their child bitmaps? My use case is, I need to update a bitmap, changing it's texture when Android tabs away and back. I didn't notice this before but sub bitmaps have their own "extra" member, so even though the bitmap pointer stays the same, the sub bitmaps are out of date because extra->texture doesn't get updated.
>

The reason is that Allegro itself never needs it. (The automatic
texture restoration and bitmap conversion both already work with
sub-bitmaps.)

This doesn't mean there is a reason not to add it though. What did you
think the API should look like? Something like below?

ALLEGRO_BITMAP *bitmap = al_get_first_sub_bitmap(parent);
while (bitmap) {
    update_bitmap(bitmap);
    bitmap = al_get_next_sub_bitmap(bitmap);
}

Also, what exactly do you mean with extra->texture doesn't get
updated? My impression is you are not supposed to access internals
like that - so maybe we can change something else which makes this
whole use case unnecessary? I.e. I'm not really sure what exactly you
mean with "I need to update a bitmap".




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