Re: [AD] native image loaders

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


On Sat, Apr 10, 2010 at 1:51 AM, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> On 2010-04-09, Matthew Leverton <meffer@xxxxxxxxxx> wrote:
>> Then you'd need to make PNG and JPEG absolute requirements for
>> building Allegro image, even on Windows. Otherwise, you have the same
>> problem.
>
> Right.  That was my intention since suggesting the GDI+ backend.

>> Your concerns are valid, but I'm not
>> sure they have any significance in the common-use sense.
>>
>> Basically, you won't ever be able to guarantee that anything works
>> unless you provide a complete binary package, core Allegro and all.
>>
> Ok, true.  If we had dynamic loading then it wouldn't be an issue.
>
I don't mind writing the dynamic loading code myself if that means we
can do away with allegro_flac, allegro_ogg, and allegro_modaudio, etc.
I assume that only image/audio loading routines are candidates for
dynamic loading, since the rest of Allegro is pretty much well
defined. The benefit of dynamic linking would basically be for Linux
distro packages, as you could then build Allegro without absolutely
depending on something as trivial as libdumb. I don't particularly see
it as useful on Windows.

I guess it wouldn't hurt to make dynamic coding optional... that is,
you can either link at Allegro compile time, or defer it to run time.
I wouldn't object to certain formats being made mandatory by the build
process: PNG and JPEG to guarantee a minimal subset of behavior. It
might actually give people incentive to not use BMPs for everything.
:P (Plus, it's something that is easy to change in the future.)

I don't see any reason to make any audio codec mandatory (other than
trivial ones like WAV). Within the regular scope of Allegro, audio is
never "required." Obviously people would have to check for NULL
pointers.

I suppose it would look like:

int acodecs = al_init_acodec_addon(ALLEGRO_ACODEC_VORBIS | ALLEGRO_ACODEC_FLAC);
// int acodecs = al_init_acodec_addon(ALLEGRO_ACODEC_ALL);
if (acodecs & ALLEGRO_ACODEC_VORBIS) { /* vorbis is available */ }

At init time, the external libraries could be dynamically loaded if needed.

--
Matthew Leverton




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