Re: [AD] al_convert_bitmap

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


On 2011-06-15, Matthew Leverton <meffer@xxxxxxxxxx> wrote:
> I think the following *mutually exclusive* flags are simple enough:
> 
> ANY_BITMAP: try video, if it fails, create memory, and add it to the
> list of auto convert. default.
> VIDEO_BITMAP: only try video
> MEMORY_BITMAP: only try memory
> 
> * When a display is created, loop through the list of
> bitmaps-to-be-converted and convert them IF the display option was not
> disabled.
> 
> * When a display is destroyed, try to transfer all video bitmaps to
> another compatible display (as currently is happening). If that fails
> then convert them to memory (as currently is happening) and add them
> to the list of bitmaps to be converted. ALL video bitmaps that are
> converted to memory would be added to that list... regardless of how
> they were initially created.

That's fine as far as the "new" bitmap flags.

After creation, we need to be able to differentiate between true video
and true memory bitmaps to invoke the software rendering path, and some
few users might want to as well.  I assume that after creation, ANY
really means "memory-but-convertible".  Since you say they are mutually
exclusive, any checks like "flags & MEMORY" will need to become
"flags & (MEMORY|ANY)".

Okay, but wouldn't it be simpler to set the MEMORY flag for all memory
bitmaps, and make the ANY flag a modifier for memory bitmaps?
Which happens to be what is in SVN already.

Taking it just a little step further... it's very tempting to try to
generalise ANY as an orthogonal flag.  This is exactly how I arrived at
my proposal.

Peter




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