|Stable release||5.0.10 / June 16, 2013|
|Type||Multimedia and Games SDK|
|License||Allegro 4: Beerware
Allegro 5: zlib
Allegro is a software library for video game development. The functionality of the library includes support for basic 2D graphics, image manipulation, text output, audio output, MIDI music, input and timers, as well as additional routines for fixed-point and floating-point matrix arithmetic, Unicode strings, file system access, file manipulation, data files, and (limited, software-only) 3D graphics. The library is written in the C programming language and designed to be used with C or C++. It comes with extensive documentation and many examples.
As of version 4.0, programs that use the library work on DOS, Microsoft Windows, BeOS, Mac OS X, and various Unix-like systems with (or without) X Window System, abstracting their application programming interfaces (APIs) into one portable interface. There is also an independent port of Allegro on AmigaOS 4. Version 5.0 supports Microsoft Windows, Mac OS X, Unix-like systems, Android, and iOS.
Initially standing for Atari Low-Level Game Routines, Allegro was originally created by Shawn Hargreaves for the Atari ST in the early 1990s. However, Shawn abandoned the Atari version as he realized the platform was dying, and reimplemented his work for the Borland C++ and DJGPP compilers in 1995. Support for Borland C++ was dropped in version 2.0, and DJGPP was the only supported compiler. As DJGPP was a DOS compiler, all games which used Allegro therefore used DOS. Around 1998, Allegro branched out into several versions. A port to Microsoft Windows, WinAllegro, was created, and also during this time, a Unix port of Allegro, XwinAllegro, was created. These various ports were brought together during the Allegro 3.9 WIP versions, with Allegro 4.0 being the first stable version of Allegro to support multiple platforms. The current version of Allegro supports Unix (Linux, FreeBSD, Irix, Solaris, Darwin), Windows (MSVC, MinGW, Cygwin, Borland C++), Mac OS X and, up to the 4.2 version, BeOS, QNX, and DOS (DJGPP, Watcom). An iPhone port is being developed too. Shawn Hargreaves is no longer involved with Allegro.
For hardware-accelerated 2D and 3D graphics on Linux, Mac OS X and DOS, AllegroGL and OpenLayer are available. They are two add-on libraries that use OpenGL for accelerated graphics routines and use Allegro for all other gaming needs. Note that, combined with Glide and MesaFX (using 3dfx hardware), AllegroGL is one of the few available opensource solutions for hardware accelerated 3D under DOS.
Current development is focused on the Allegro 5 branch, with the current version 5.0.10. Allegro 5 is a complete redesign of the API and much of the internal operation of the library. An effort was made to make the API more consistent, and multi-thread safe. By default, the library will now be hardware accelerated using OpenGL or DirectX rendering backends where appropriate. Many of the addons that existed as separate projects for Allegro 4 will be rewritten to interface more seamlessly with Allegro proper and will be bundled with the default installation. Allegro 5 is intended to be event driven.
Allegro provides the following graphic functions:
- Vector drawing:
- pixels, lines, rectangles, triangles, circles, ellipses, arcs, Bézier splines
- shape fill, with or without pattern
- polygons: flat, Gouraud, textured (3D) and translucent
- masked, compressed and compiled sprites
- blitting, rotation, stretching, reduction, alpha blending, Gouraud shading
- native support for BMP, LBM, PCX and TGA files (others supported with library extensions)
- Color palettes:
- color palette manipulation (reading, writing, conversion)
- conversion of color formats RGB <-> HSV
- support for different encodings and conversion, default is UTF-8
- bitmap fonts (masking, colouring, alignment)
- draw directly on the screen or on any-size memory bitmaps
- hardware scrolling and triple buffering (where available), mode-X split screen
- animation functions for FLI/FLC format
The community of Allegro users have contributed several library extensions to handle things like scrolling tile maps and import and export of various file formats (e.g. PNG, GIF, JPEG images, MPEG video, Ogg, MP3, IT, S3M, XM music, TTF fonts, and more). There are also bindings for several programming languages available, such as Python, Perl, Scheme, C#, D and others.
Allegro 4.x and below can be used in conjunction with OpenGL by using the library AllegroGL which extends Allegro's functionality into OpenGL and therefore the hardware. Allegro 5 natively supports OpenGL.
- Allegro Development Team. "The giftware license". Retrieved 2013-11-16.
- Harbour, Jonathan (2004). Game Programming All in One, Second Edition. Course Technology PTR. ISBN 1-59200-383-4.
- Steinke, Lennart (2003). Spielprogrammierung. BHV Verlag. ISBN 3-8266-8075-8.
- P. J. Deitel, P. J. (2006). C How to Program. How to Program. Prentice Hall. ISBN 0-13-240416-8.
- Forum posting by Shawn Hargreaves
- the iPhone directory in the svn repository
- Daniel Borca. "Mesa 3-D graphics library". Archived from the original on 2009-10-25.
- Allegro Introduction
- Official website
- Allegro game programming library on SourceForge.net
- Allegro Wiki
- Games Using Allegro
- Shawn Hargreaves's Homepage