Re: [AD] native image loaders

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


On 2010-04-09, Matthew Leverton <meffer@xxxxxxxxxx> wrote:
> Peter Wang:
> > I think it would be annoying.  I definitely want to see PNG/JPEG in the
> > main allegro_image addon.  allegro_image can support further formats on
> > different platform if they come "for free", though we should strongly
> > encourage developers to stick to PNG/JPEG/BMP/TGA/PCX for portability.
> >
> I'm currently of the opinion that both image and audio add-ons should work like:
> 
> * no explicit functions (e.g., load_bmp, load_pcx, load_ogg)
> * everything supported at compile time is part of the acodec/image addon
> * if you want to add extra formats that aren't deemed worthy of
> inclusion into Allegro proper, you can make your own add-on. But by
> rule, any officially supported format would be part of acodec/image.
> * [optional] some way to query which formats are supported (probably a
> list of registered handlers by extension)
> * the docs mention which platforms support which formats
> 
> This would mean ogg/flac/modaudio would be rolled into one single
> 'acodec' addon. And of course, none of them would be required to build
> acodec.

I don't really like it.

The current plan is not fully consistent, but I think it's simple:

- link with allegro_image => you get PNG/JPEG/BMP/TGA/PCX [*]
- link with allegro_flac => you get FLAC support
- link with allegro_vorbis => you get Ogg Vorbis support
- link with allegro_modaudio => you get XM/IT/S3M/etc support
- link with allegro_jp2k (hypothetical) => you get JPEG2000 support

[*] on all platforms these are essentially "free"

Under your plan:

- link with allegro_acodec => you *might* get Vorbis/FLAC/MOD support

At lot of people are likely to build copies of allegro_acodec without
DUMB.  If your game uses MOD music, there'll always be the question of
whether your game will run correctly, and you'll probably only find out
at run time.

If formats could *only* be supported as part of image/acodec then I
would have to say that MOD and FLAC are both unworthy.

> On Windows, I've tested it and there's no problem with linking against
> static ogg / flac libs, such that you wouldn't be forced to distribute
> extra DLLs when you don't use the functionality.

No extra DLLs but still bigger code size, which to me was the point.

Peter




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