Allegro is a cross-platform library mainly aimed at video game andmultimedia programming. It handles common, low-level tasks such ascreating windows, accepting user input, loading data, drawing images,playing sounds, etc. and generally abstracting away the underlyingplatform. However, Allegro is not a game engine: you are freeto design and structure your program as you like.
Allegro is a software library for video game development.[2][3][4] 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 3D graphics. The library is written in the C programming language and designed to be used with C, C++, or Objective-C, with bindings available for Python, Lua, Scheme, D, Go, and other languages.[5] Allegro comes with extensive documentation and many examples.
game programming with the allegro c library
Initially standing for Atari Low-Level Game Routines,[7] Allegro was originally created by Shawn Hargreaves [pl] for the Atari ST in the early 1990s. However, Hargreaves 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 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.
Current development is focused on the Allegro 5 branch, a complete redesign of both the API and much of the library's internal operation. Effort was made to make the API more consistent and multi-thread safe. By default, the library is now hardware accelerated using OpenGL or DirectX rendering backends where appropriate. Many of the addons that existed as separate projects for Allegro 4 now interface seamlessly with Allegro proper and are bundled with the default installation. Allegro 5 is event driven.
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. Also some parts of what used to be part of Allegro, is now separated as an addon in Allegro 5. These addons are distributed with the core library:[9]
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...
"Allegro is a game programming library for C/C++ developers distributedfreely, supporting the following platforms: DOS, Unix (Linux, FreeBSD, Irix, Solaris, Darwin), Windows, QNX, BeOS and MacOS X. It provides many functions for graphics, sounds, player input (keyboard, mouse and joystick) and timers. It also provides fixed and floating point mathematical functions, 3d functions, file management functions, compressed datafile and a GUI."
Another of my interests in using Allegro for the course is compatibility with the BloodshedSoftware Dev-C++ IDE (see Resources), which is also free for my students to download and install on their computers at home. Even though the computers in the lab where I teach are configured with the Windows XP operating system, my preference is to avoid using a graphics library that requires the use of Microsoft Visual Studio.
A third thing that attracts me to Allegro for this course is that it has more capability than we can possibly cover in a single one-semester course. Therefore, given that it is freely available and compatible with a free C++ IDE, my students can continue to develop their graphics programming skills long after they finish my course of instruction.
Allegro is a cross-platform game programming library for C/C++. Allegro is powerful but easy to use. It handles the low-level details of graphics, sound and input so users can concentrate on the higher level aspects of game creation and design.
Though many people find this to be an easy program to use, the potential of allegro is exponential.When using Allegro there are many ways that one can use the simple language to do with what they like.The way one uses this language is in the following way:
In five years, Allegro, an open source game programming library, has grown from a few basic 320x200 VGA routines to a robust collection of functions created from over 100 contributors. Allegro is a library that solo or independent game developers can use to focus their limited resources on game design -- not research and development. For larger, more experienced developers, Allegro creates a stable game foundation from which to build an engine.
In late 1994, programmer Shawn Hargreaves had a vision. He envisioned a free, open source game library, which would make game programming and development easier for everyone. The barriers of game development would fall. And it would be good.
Thus began Allegro, technically. Hargreaves made a few short VGA routines, threw them on the Internet, and went on with his life. The limited library did what he needed, and Hargreaves considered it done. A year later, however, a casual Allegro update changed the fate of his library. Hargreaves recalls that, "The big turning point came when I added some SVGA code, initially just because I was curious to see how it worked. It turned out that a lot of people were looking for something exactly like this, so all of a sudden I had hundreds of users, and things just grew from there. I later added a sound player, true color graphics modes, and most recently porting to several platforms."
Allegro currently is in version 3.9x, with 4.0 to come soon. A far cry from its DJGPP DOS days, it is currently compatible with DJGPP, Watcom, MSVC, and Linux. X-Windows and BeOS compatibility are being worked on as of this writing. There are also well over one hundred functions within the Allegro library, ranging from basic drawing functions to sound/MIDI functions. It supports multiple resolutions, ranging from unusual 80 x 80 to standard Mode 13 to a whopping 32-bit 1600 x 1200 (assuming the graphics card supports it). Various VESA modes are supported as well. Different sprite types are supported, such as compiled and RLE. There are multiple ways to display a sprite, including masked, transparent, and gourand. Other blitting techniques include rotation and scaling, as well as standard sprite axis flipping. All the standard drawing primitives are also supported. On the other end of the scale, many polygon functions are supported (including texture mapping and gourand shading), as well as splines. All input is fully supported, minus force feedback (which may change by this writing). It also includes a full-fledged GUI designer, which allows pseudo-Visual Basic game setups.
Allegro supports various media as well. It has strong audio support for MIDI, digital samples, and audio streams. FLIC routines are also included. Regarding data, multi-object data files can be stored and accessed through an included grabber utility. The grabber is a self-contained program which, via a GUI system, allows the user to organize and preview the contents of the datafile. Any necessary files, ranging from text files to palettes, can be stored within one data file. This not only organizes the files neatly for game distribution, but also allows for easier management of data. The datafile can be easily accessed from within the game code through the file.
"After looking through the source and seeing how organized it was, I decided it would be fruitful to rip out the guts and stick my old Moebius library functions in. The procedure went flawlessly, aside from a few minor linking errors and stuff, and I ditched my keyboard and gamepad handlers for their Allegro counterparts, since they worked just as well." This is a common case; indeed, teams often end up scrapping their own routines for the easier to use Allegro.
Allegro has also become the choice of developers who want to concentrate on things other than screen setting and memory management. For some developers, Allegro is beyond practical. Arne Strout, head of the Megaman 21xx project, states that the development would be much more time consuming without Allegro. "(We might have been able to work without Allegro), maybe after another extra year to develop a suitable graphics library. Graphics libraries are the life of the game," says Strout.
The Allegro games themselves have created quite a following. Allegro now has a webring with over 160 sites, with quite a few dedicated exclusively to Allegro-developed titles. There is also the Allegro Game Reviews Index, which has a small stable of reviewed games.
The main goal from Allegro 3.0 to 4.0, according to the Allegro programmers, has been portability. The different ports of Allegro are being combined into one big "super-library". "The aim is to make it very simple to write programs that will compile on any of these platforms with only minor modifications, if any, and it's progressing very well indeed. I think this will make it very attractive for people wanting to write multi-platform games," says Foot. Hargreaves states that, "Most of the code will work unchanged on any OS you care to mention, and the strength of being a nice flexible and easily understood API remains a strength wherever you are running it."
Damon Brown started programming on his VIC 20 at age eight while winning his first award for writing: The Calbery Award. He is currently at Northwestern University studying for his Masters in Magazine Publishing. His hobbies include solo freeware game development, occult studies and deejaying. E-mail him at [email protected], or check out his website at www.geocities.com/SiliconValley/Pines/6547/. 2ff7e9595c
Bình luận