Question about Allegro's PNG support
Frank Drebin

Hi guys - or should I say Hi Edgar who is probably the first one to answer ;-)

when it comes to support of different image formats the manual says:

The following types are built into the Allegro image addon and guaranteed to be available: BMP, DDS, PCX, TGA. Every platform also supports JPEG and PNG via external dependencies.

I just want to know the meaning of the second sentence. Does this mean that it is guaranteed that JPEG and PNG will work on every platform or does this mean that JPEG and PNG is supported only if external dependencies are available which you'll never know?

Polybios

It depends on whether you include / link the required libraries (e.g. libpng), or rather whether your Allegro build does that. As the libraries are available for every platform Allegro supports (AFAIK), you can always include / link them when building Allegro. Usually, you provide them along with your executable in binary form (e.g. DLLs) or, even better, just statically link them into your application's binary.

So the sentence you refer to just means that Allegro devs have not taken the effort to reimplement custom loading of image formats for which there are libraries available that are portable and widely used. Rather, Allegro uses these libraries to accomplish the task. Their availability is, however, a build-time, not a run-time issue.

Frank Drebin

Thanks - great explanation!

Edgar Reynaldo

Haha, I have no life. >:(

To add to what PolyBios said, the build time support is controlled in CMake by the WANT_PNG cmake variable. So you can pass -DWANT_PNG=On or enable it in cmake-gui.

Thread #617827. Printed from Allegro.cc