Allegro library
Encyclopedia
Allegro is a free
and open source 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.
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 interface
s (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
, and iOS.
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.
, 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 can be used in conjunction with OpenGL
by using the library AllegroGL which extends Allegro's functionality into OpenGL and therefore the hardware.
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 3D and 2D acceleration 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.
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...
and open source 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.
As of version 4.0, programs that use the library work on DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...
, Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...
, BeOS
BeOS
BeOS is an operating system for personal computers which began development by Be Inc. in 1991. It was first written to run on BeBox hardware. BeOS was optimized for digital media work and was written to take advantage of modern hardware facilities such as symmetric multiprocessing by utilizing...
, Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...
, and various Unix-like systems
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....
with (or without) X Window System
X Window System
The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...
, abstracting their application programming interface
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...
s (APIs) into one portable interface. There is also an independent port of Allegro on AmigaOS 4
AmigaOS 4
AmigaOS 4, , is a line of Amiga operating systems which runs on PowerPC microprocessors. It is mainly based on AmigaOS 3.1 source code, and partially on version 3.9 developed by Haage & Partner...
.
Version 5.0 supports Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...
, Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...
, Unix-like systems
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....
, and iOS.
The library is written in the C programming language
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....
and designed to be used with C or C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...
. It comes with extensive documentation and many examples.
Addons
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, GIFGIF
The Graphics Interchange Format is a bitmap image format that was introduced by CompuServe in 1987 and has since come into widespread usage on the World Wide Web due to its wide support and portability....
, JPEG
JPEG
In computing, JPEG . The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image quality. JPEG typically achieves 10:1 compression with little perceptible loss in image quality....
images, MPEG video, Ogg
Ogg
Ogg is a free, open container format maintained by the Xiph.Org Foundation. The creators of the Ogg format state that it is unrestricted by software patents and is designed to provide for efficient streaming and manipulation of high quality digital multimedia.The Ogg container format can multiplex...
, MP3
MP3
MPEG-1 or MPEG-2 Audio Layer III, more commonly referred to as MP3, is a patented digital audio encoding format using a form of lossy data compression...
, IT
Impulse Tracker
Impulse Tracker is a multi-track digital sound tracker . It was one of the last tracker programs for the DOS platform. It was authored by Jeffrey "Pulse" Lim, and example music was provided by Jeffrey Lim and Chris Jarvis...
, S3M
S3M (file format)
The S3M format is an advanced module format, and is the successor to the STM format used by the original Scream Tracker. Both formats are based on the original MOD format used on the Commodore Amiga computer....
, XM music, TTF
TrueType
TrueType is an outline font standard originally developed by Apple Computer in the late 1980s as a competitor to Adobe's Type 1 fonts used in PostScript...
fonts
Typeface
In typography, a typeface is the artistic representation or interpretation of characters; it is the way the type looks. Each type is designed and there are thousands of different typefaces in existence, with new ones being developed constantly....
, and more). There are also bindings
Language binding
In computing, a binding from a programming language to a library or OS service is an API providing that service in the language.Many software libraries are written in systems programming languages such as C or C++...
for several programming languages available, such as Python
Python (programming language)
Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...
, Perl
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...
, Scheme, C#, D
D (programming language)
The D programming language is an object-oriented, imperative, multi-paradigm, system programming language created by Walter Bright of Digital Mars. It originated as a re-engineering of C++, but even though it is mainly influenced by that language, it is not a variant of C++...
and others.
Allegro can be used in conjunction with OpenGL
OpenGL
OpenGL is a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics. The interface consists of over 250 different function calls which can be used to draw complex three-dimensional scenes from simple primitives. OpenGL...
by using the library AllegroGL which extends Allegro's functionality into OpenGL and therefore the hardware.
History
Initially standing for "Atari Low-Level Game Routines", Allegro was originally created by Shawn Hargreaves for the Atari STAtari ST
The Atari ST is a home/personal computer that was released by Atari Corporation in 1985 and commercially available from that summer into the early 1990s. The "ST" officially stands for "Sixteen/Thirty-two", which referred to the Motorola 68000's 16-bit external bus and 32-bit internals...
in the early 1990s. However, Shawn abandoned the Atari version as he realized the platform was dying, and reimplemented his work for the Borland
Borland
Borland Software Corporation is a software company first headquartered in Scotts Valley, California, Cupertino, California and finally Austin, Texas. It is now a Micro Focus subsidiary. It was founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad and Philippe Kahn.-The 1980s:...
C++ and DJGPP
DJGPP
DJGPP is a development suite for 386+ IBM PC compatibles which supports DOS-enabled operating systems. It is guided by DJ Delorie, who began the project in 1989. It is a port of the popular GCC compiler, as well as mostly GNU utilities such as bash, find, tar, ls, awk, sed, and ld to DPMI...
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
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...
compiler, all games which used Allegro therefore used DOS. Around 1998, Allegro branched out into several versions. A port to Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...
, 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
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...
, FreeBSD
FreeBSD
FreeBSD is a free Unix-like operating system descended from AT&T UNIX via BSD UNIX. Although for legal reasons FreeBSD cannot be called “UNIX”, as the direct descendant of BSD UNIX , FreeBSD’s internals and system APIs are UNIX-compliant...
, Irix
IRIX
IRIX is a computer operating system developed by Silicon Graphics, Inc. to run natively on their 32- and 64-bit MIPS architecture workstations and servers. It was based on UNIX System V with BSD extensions. IRIX was the first operating system to include the XFS file system.The last major version...
, Solaris, Darwin
Darwin (operating system)
Darwin is an open source POSIX-compliant computer operating system released by Apple Inc. in 2000. It is composed of code developed by Apple, as well as code derived from NeXTSTEP, BSD, and other free software projects....
), Windows (MSVC, MinGW
MinGW
MinGW , formerly mingw32, is a native software port of the GNU Compiler Collection and GNU Binutils for use in the development of native Microsoft Windows applications; MinGW can function either as a cross compiler targeting Windows or as a native toolchain run on Windows itself...
, Cygwin
Cygwin
Cygwin is a Unix-like environment and command-line interface for Microsoft Windows. Cygwin provides native integration of Windows-based applications, data, and other system resources with applications, software tools, and data of the Unix-like environment...
, Borland C++
Borland C++
Borland C++ is a C and C++ programming environment for MS-DOS and Microsoft Windows. It was the successor to Turbo C++, and included a better debugger, the Turbo Debugger, which was written in protected mode DOS....
), Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...
and, up to the 4.2 version, BeOS
BeOS
BeOS is an operating system for personal computers which began development by Be Inc. in 1991. It was first written to run on BeBox hardware. BeOS was optimized for digital media work and was written to take advantage of modern hardware facilities such as symmetric multiprocessing by utilizing...
, QNX
QNX
QNX is a commercial Unix-like real-time operating system, aimed primarily at the embedded systems market. The product was originally developed by Canadian company, QNX Software Systems, which was later acquired by Canadian BlackBerry-producer Research In Motion.-Description:As a microkernel-based...
, and DOS (DJGPP
DJGPP
DJGPP is a development suite for 386+ IBM PC compatibles which supports DOS-enabled operating systems. It is guided by DJ Delorie, who began the project in 1989. It is a port of the popular GCC compiler, as well as mostly GNU utilities such as bash, find, tar, ls, awk, sed, and ld to DPMI...
, Watcom
Watcom C compiler
The Watcom C/C++ compiler is a compiler for the computer programming languages C and C++ that produces executable programs for several platforms and operating systems. The code it produces for MS-DOS executes very fast. It was one of the first compilers to support the Intel 80386 "protected mode"...
). An iPhone port is being developed too. Shawn Hargreaves is no longer involved with Allegro.
For hardware accelerated 3D and 2D acceleration on Linux, Mac OS X and DOS, AllegroGL and OpenLayer are available. They are two add-on libraries that use OpenGL
OpenGL
OpenGL is a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics. The interface consists of over 250 different function calls which can be used to draw complex three-dimensional scenes from simple primitives. OpenGL...
for accelerated graphics routines and use Allegro for all other gaming needs. Note that, combined with Glide
Glide API
Glide is a 3D graphics API developed by 3dfx Interactive for their Voodoo Graphics 3D accelerator cards. Although it originally started as a proprietary API, it was later open sourced by 3dfx. It was dedicated to gaming performance, supporting geometry and texture mapping primarily, in data...
and MesaFX
Mesa 3D
Mesa 3D is an open source 3D computer graphics library that provides a generic OpenGL implementation for rendering three-dimensional graphics on multiple platforms. It was initially developed by Brian Paul in August 1993, and is still maintained by him today...
(using 3dfx
3dfx
3dfx Interactive was a company that specialized in the manufacturing of 3D graphics processing units and, later, graphics cards. It was a pioneer in the field for several years in the late 1990s until 2000 when it underwent one of the most high-profile demises in the history of the PC industry...
hardware), AllegroGL is one of the few available opensource solutions for hardware accelerated 3D under DOS.
Graphic functions
- Vector drawing:
- pixels, lines, rectangles, circles, ellipses, arcs, Bezier splines
- shape fill, with or without pattern
- polygons: flat, Gouraud, textured (3D) and translucent
- Sprites:
- 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
- Text:
- support for different encodings and conversion, default is UTF-8
- bitmap fonts (masking, colouring, alignment)
- Misc:
- 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
Allegro 5
Current development is focused on the Allegro 5 branch, with the current version 5.0.5. 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.See also
- SDL (Simple DirectMedia Layer)Simple DirectMedia LayerSimple DirectMedia Layer is a cross-platform, free and open source multimedia library written in C that presents a simple interface to various platforms' graphics, sound, and input devices....
- DirectXDirectXMicrosoft DirectX is a collection of application programming interfaces for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with Direct, such as Direct3D, DirectDraw, DirectMusic, DirectPlay,...
- OpenGLOpenGLOpenGL is a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics. The interface consists of over 250 different function calls which can be used to draw complex three-dimensional scenes from simple primitives. OpenGL...
- ClanLibClanLibClanLib is a cross-platform C++ game SDK, currently supporting Microsoft Windows, Linux and Mac OS X. It has full hardware accelerated graphics support through OpenGL, and also a software renderer...
- OpenMLOpenMLOpen Media Library is a free, cross-platform programming environment designed by the Khronos Group for capturing, transporting, processing, displaying, and synchronizing digital media .-See also:* SDL* Allegro* ClanLib* OpenGL* OpenAL* PLIB-External links:* *...
- PLIBPLIBPLIB is a suite of Open Source portable computer game libraries, originally written by Steve Baker in 1997 and licensed under the LGPL.PLIB includes sound effects, music, a complete 3D engine, font rendering, a simple windowing library, a game scripting language, a GUI, networking, 3D math library...
- XNAMicrosoft XNAMicrosoft XNA is a set of tools with a managed runtime environment provided by Microsoft that facilitates video game development and management. XNA attempts to free game developers from writing "repetitive boilerplate code" and to bring different aspects of game production into a single system...
- List of game engines
- SFML