Re: [AD] al_convert_bitmap

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


On Sun, 2011-06-12 at 18:19 -0500, Matthew Leverton wrote:
> On Sun, Jun 12, 2011 at 11:16 AM, Elias Pschernig
> <elias.pschernig@xxxxxxxxxx> wrote:
> > I also left in al_convert_all_video_bitmaps for now. Can maybe remove it
> > now or at least rename.
> >
> I would leave it in and make a display option to disable the auto
> conversion behavior. That should prevent any complaints. I would use
> an option as opposed to a flag because a) negative flags are
> confusing, b) it gives the ability to offer different conversions
> methods in the future (although I cannot think of any other useful
> scenarios...), and c) it's rather obscure and probably not worth
> taking up a bitmask.

Would the option have any effect on al_destroy_display? Maybe it should
also prevent the conversion to memory bitmaps there.

> 
> The function could be named something like al_upload_bitmap_textures().
> 

In theory a video bitmap doesn't need a texture attached (in fact we
probably will want bitmaps which have an opengl render buffer instead -
but haven't looked much into it yet). So well, I somehow don't like the
word "texture" in the name.

> Anyway, I've attached a test program. (apologies for it being an abuse
> of copy/paste)
> 
> It fails one test based on my expectations:
> 
> 1) create display
> 2) b = create video bitmap
> 3) destroy display
> 4) b == memory (okay so far)
> 5) create display
> 6) b == memory (expect video...)
> 
> I would expect it to be a video bitmap in step 6, but it's still stuck
> as a memory bitmap. (Alternatively, it could be automatically
> destroyed and unusable in step 4. But I think that's unnecessarily
> strict.)
> 
> In other words, I would add successfully created video bitmaps to the
> list of bitmaps to try to convert.

I think I almost prefer it to be destroyed. Else there is no difference
between a VIDEO bitmap and a VIDEO|ANY bitmap.

> So to me, the check_to_be_converted_list_add(bitmap) should always be
> called in _al_convert_to_memory_bitmap() (assuming that latter
> function is only called when a display is destroyed).
> 

-- 
Elias Pschernig <elias.pschernig@xxxxxxxxxx>





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