The Allegro Wiki is migrating to github at https://github.com/liballeg/allegro_wiki/wiki

LoadPNG

From Allegro Wiki
Jump to: navigation, search

PNG (Portable Network Graphics) is a cool raster image file format. libpng is the reference library for working with PNG files. loadpng is some glue that makes it easy to use libpng to load and save bitmaps from Allegro programs.

Home Page


Incorporating loadpng in Allegro v4.4

Bundled with Allegro

loadpng is bundled with Allegro from v4.3.10. It is found in allegro/addons.


A plan to integrate loadpng more tightly - by User:Matt_Smith

This will change the usage slightly. register_bitmap_file_type() will no longer be required, but will do no harm.

This will make Allegro dependent on libpng and zlib. The build process should detect the presence of these and set a preprocessor variable. The source code will then compile either the working loadpng code, or dummy functions that always return NULL (to signify failure to load the png). This will ensure ABI compatability, even if the libs aren't found.

Windows users should be advised not to distribute the DLL if it is built without PNG support, as it will silently fail to load PNG in all programs that use it.

When linking Allegro built with PNG support, it will be necessary to link libpng and zlib - even for programs that don't use PNG. This will be invisible for Linux users as it will be covered by `allegro-config --libs`. The documentation for Windows users will need to be updated to this effect.