Some people complain that Allegro produces very large executables. This is certainly true: a simple "hello world" program will be about 200k. But don't worry, it is a relatively fixed overhead and won't increase as your program gets larger. As George so succinctly put it, anyone who is concerned about the ratio between library and program code should just get to work and write more program code :-)
Having said that, there are several things you can do to make your programs smaller:
DECLARE_GFX_DRIVER_LIST( driver1 driver2 etc... )where the driver names are any of the defines:
GFX_DRIVER_VGA GFX_DRIVER_MODEX GFX_DRIVER_VBEAF GFX_DRIVER_VESA2L GFX_DRIVER_VESA2B GFX_DRIVER_XTENDED GFX_DRIVER_ATI GFX_DRIVER_MACH64 GFX_DRIVER_CIRRUS64 GFX_DRIVER_CIRRUS54 GFX_DRIVER_PARADISE GFX_DRIVER_S3 GFX_DRIVER_TRIDENT GFX_DRIVER_ET3000 GFX_DRIVER_ET4000 GFX_DRIVER_VIDEO7 GFX_DRIVER_VESA1This construct must be included in only one of your C source files (_not_ a header file!). The ordering of the names is important, because the autodetection routine works down from the top of the list until it finds the first driver that is able to support the requested mode. I suggest you stick to the default ordering given above, and simply delete whatever entries you aren't going to use.
As a rule, removing the MODEX and XTENDED drivers will save a fair amount of space, as will removing all of the SVGA drivers if you are only going to use standard VGA modes. The individual chipset drivers are quite small, so there really isn't much point in taking them out.
DECLARE_COLOR_DEPTH_LIST( depth1 depth2 etc... )where the color depth names are any of the defines:
COLOR_DEPTH_8 COLOR_DEPTH_15 COLOR_DEPTH_16 COLOR_DEPTH_24 COLOR_DEPTH_32Removing any of the color depths will save quite a bit of space, with the exception of the 15 and 16 bit modes: these share a great deal of code, so if you are including one of them, there is no reason not to use both. Be warned that if you try to use a color depth which isn't in this list, your program will crash horribly!
DECLARE_DIGI_DRIVER_LIST( driver1 driver2 etc... )using the digital sound driver defines:
DIGI_DRIVER_GUS DIGI_DRIVER_SBand for the MIDI music:
DECLARE_MIDI_DRIVER_LIST( driver1 driver2 etc... )using the MIDI driver defines:
MIDI_DRIVER_AWE32 MIDI_DRIVER_DIGMID MIDI_DRIVER_ADLIB MIDI_DRIVER_SB_OUT MIDI_DRIVER_MPUIf you are going to use either of these constructs, you must use both. If you only want to include digital sound drivers, simply write DECLARE_MIDI_DRIVER_LIST() to prevent the inclusion of any music drivers at all.
#define ALLEGRO_COLOR16 #define ALLEGRO_COLOR24 #define ALLEGRO_COLOR32If you comment out any of these definitions and then rebuild the library, you will get a version without any support for the absent color depths, which will be even smaller than using the DECLARE_COLOR_DEPTH_LIST() macro. Removing the ALLEGRO_COLOR16 define will get rid of the support for both 15 and 16 bit hicolor modes, since these share a lot of the same code.