C C++ Objective-C CMake Python Java Other
Switch branches/tags
Clone or download
SiegeLord Fix the NumVertices argument in DrawIndexedPrimitiveUP calls.
This was incorrectly set to MaxVertexIdx instead... for some reason this
never crashed ex_prim.
Latest commit d775718 Jun 16, 2018
Failed to load latest commit information.
addons Fix the NumVertices argument in DrawIndexedPrimitiveUP calls. Jun 17, 2018
android fix some warnings for the Android port (#843) Nov 21, 2017
cmake Add hints for mingw-w64 path locations for DX includes/libs. Dec 18, 2017
contrib/luajit Fix the Luajit's CMakeLists. Dec 24, 2017
demos Add a gradle based Android build Oct 8, 2017
docs Add some explanation and examples for projective transformations. May 5, 2018
examples update ex_physfs to use PHYSFS_mount May 30, 2018
include/allegro5 Bump version to 5.2.5 (GIT). Feb 24, 2018
misc run Python 2 scripts in misc/ with python2 and regenerate (#848) Oct 28, 2017
python fixed corrupted regexps Jun 23, 2017
src Add error logging to every failure path in the image addon. Mar 8, 2018
tests image: add WebP support with libwebp Sep 29, 2017
tools Remove AL_CONST everywhere. Mar 2, 2010
.gitignore Add deps/ to .gitignore Mar 1, 2018
.travis.yml Try fixing Travis on OSX. (#855) Oct 28, 2017
CMakeLists.txt Bump version to 5.2.5 (GIT). Feb 24, 2018
CONTRIBUTORS.txt Update CONTRIBUTORS.txt Feb 6, 2018
LICENSE.txt Squashed commit of the following: Sep 6, 2015
README.md Add a symlink README.md pointing to README.txt. Mar 25, 2016
README.txt image: add WebP support with libwebp Sep 29, 2017
README_android.txt Add a gradle based Android build Oct 8, 2017
README_cmake.txt Split up readme_a5.txt; try to streamline the build instructions. Jun 14, 2010
README_iphone.txt Fix spelling of the cmake Xcode generator in the readme. Jun 1, 2015
README_macosx.txt Add retina display support to OSX. Jun 3, 2015
README_make.txt Add .gitignore and ignore build/ dir May 7, 2016
README_msvc.txt Minor updates to the build documentation. Jan 8, 2011
README_packaging.txt Add a readme for packagers. Oct 25, 2010
README_pkgconfig.txt Mention path and static linking for pkg-config. Apr 26, 2015
README_raspberrypi.txt Add notes about running Raspberry Pi VM with qemu. Dec 27, 2012
README_releasing.txt Don't rename the archives for the first release, to make packagers' l… Jul 22, 2017
README_windows.txt Don't link to xinput and d3dx9. Mar 20, 2016
allegro5.cfg X11: make compositor bypass configurable, and bypass only when fullsc… Feb 9, 2018
appveyor.yml Use version 1.5.0 of the AllegroDeps package for AppVeyor. Dec 13, 2016
indent.pro Added -bls and -l80 and some types to indent.pro. Sep 23, 2008


Welcome to Allegro!

Allegro is a cross-platform library mainly aimed at video game and multimedia programming. It handles common, low-level tasks such as creating windows, accepting user input, loading data, drawing images, playing sounds, etc. and generally abstracting away the underlying platform. However, Allegro is not a game engine: you are free to design and structure your program as you like.

Allegro 5 has the following additional features:

  • Supported on Windows, Linux, Mac OSX, iPhone and Android
  • User-friendly, intuitive C API usable from C++ and many other languages
  • Hardware accelerated bitmap and graphical primitive drawing support (via OpenGL or Direct3D)
  • Audio recording support
  • Font loading and drawing
  • Video playback
  • Abstractions over shaders and low-level polygon drawing
  • And more!

This readme contains general information which applies to all platforms that Allegro builds on.

README_cmake.txt discusses some build options for cmake.

README_msvc.txt discusses compilation on Windows with Microsoft Visual C/C++.

README_make.txt discusses compilation with GNU make. This applies to Unix-like operating systems such as Linux, MacOS X and MinGW on Windows.

README_macosx.txt has a few additional notes for MacOS X.

README_iphone.txt discusses iPhone operating systems.


We assume you have C and C++ compilers installed and functioning. We support gcc, clang and MSVC.

Allegro also requires CMake 2.8.5 or later to build. You may download it from http://www.cmake.org/

Library dependencies

Allegro is divided into a core library and a number of addon libraries. The core library depends on certain libraries to function. If you don't have those, nothing will work. These are required for the core library:

  • DirectX SDK (Windows only)

    You can get this for MSVC from the Microsoft web site (large download).

    Alternatively, smaller downloads for MSVC and MinGW are available here: http://liballeg.org/download.html#miscellaneous-files. Some MinGW distributions come with sufficient DirectX SDK to support compiling Allegro.

  • X11 development libraries (Linux/Unix only) The libraries will be part of your Linux distribution, but you may have to install them explicitly.

  • OpenGL development libraries (optional only on Windows)

The addons, too, may require additional libraries. Since the addons are strictly optional, they are not required to build Allegro, but a lot of functionality may be disabled if they are not present.

Windows users may find some precompiled binaries for the additional libraries from http://gnuwin32.sourceforge.net/. You need to get the bin and lib packages. The bin packages contain DLLs, and the lib packages contain the headers and import libraries.

Mac users may find some dependencies in Homebrew, Fink or MacPorts. http://brew.sh/, http://www.finkproject.org/ and http://www.macports.org/

Linux users likely have all the dependencies already, except PhysicsFS and DUMB. If your distribution uses separate development packages, they will need to be installed. The packages are probably named *-dev or *-devel.

These are the dependencies required for the addons:

On Windows it may be a pain to place all these libraries such that they can be found. Please see the README_cmake.txt section on the "deps subdirectory" when the time comes.

API documentation

To build the documentation you will need Pandoc. Pandoc's home page is http://johnmacfarlane.net/pandoc/

Installing Pandoc from source can be challenging, but you can build Allegro without building the documentation.

Online documentation is available on the Allegro web site: http://docs.liballeg.org/

Building with CMake

Building with CMake is a two step process. During the configuration step, cmake will detect your compiler setup and find the libraries which are installed on your system. At the same time, you may select options to customise your build. If you are unsure of what you are doing, leave all the options at the defaults.

Once the configuration step is successful, you will invoke another tool to build Allegro. The tool depends on your compiler, but is usually either make, or your IDE.

To avoid problems, unpack Allegro into a directory without spaces or other "weird" characters in the path. This is a known problem.

Now read README_msvc.txt, README_make.txt or README_macosx.txt.