Jump to content

  • Log In with Google      Sign In   
  • Create Account

Initial thoughts on Allegro 5

Posted by Trapper Zoid, 03 August 2012 · 684 views

I've got a simple "try all the basics" program running using Allegro 5 - bouncing bitmap with sound effects, playing music with an on-screen FPS counter using the font system and outputting keystrokes to the debug console. Nearly everything seems to be working fine. The only thing I haven't got working is tracker music formats, but since I'm not sure if I need that I should be fine with Ogg Vorbis. Bitmap-wise I know Allegro can read PNG files and that's all I need. From my brief look at Allegro 5 so far it seems like it will do everything I want it do. It's quite straightforward and simple enough to integrate with whatever I wish to do. I'll need to try it out on something proper to get a better feel of it of course, but so far it feels nice enough.

The only real hassle was getting all the libraries compiled and linked correctly, especially when I wanted to move from the standard defaults. Make sure there are separate debug and release libraries. Do you build for 32-bit only or also 64-bit, and maybe PowerPC if you're on a Mac? Do you go with dynamic linking, where you have to make sure you bundle all the libraries with your game and link them correctly, or static linking where you have to make sure the compiler links with the right libraries instead of defaulting to the dynamic ones.

It wasn't particularly difficult, but it did involve heaps of retries and fiddling with settings to get it done right. I must of recompiled and reinstalled the Allegro libraries about fifty times.

I'm going with static linking BTW, because I think I'm less likely to screw up including the right libraries at release time. I'm not sure about the 32-bit vs. 64-bit decision. I don't think it will make much difference to compile for both, but I also don't think it should make much difference for the sorts of 2D games I want to make to stick with 32-bit only. I had a check of all the games installed on the iMac I'm developing on and all the games appear to be 32-bit only (or older, PowerPC and/or 32-bit games; no 64-bit at all) so I assume there is some reason behind that.

Allegro 5 is quite a nice package compared to previous versions. And I very much like the architecture they've come up with. I was playing around with it last year when I was trying to get a dynamic binding for D to work and really enjoyed it. If I were doing a 2D game in C or C++ right now, it would likely be my first choice over other alternatives like SFML or SDL.
SDL has been in this weird limbo between 1.2 and 2.0 for years. SFML seems nice enough from what I've seen and I know there are loads of people on the forums who swear by it, but it's very much a C++ library.
I've been using SDL 2 lately in D. It's actually quite stable and usable now. Plus, IIRC, the 1.2 compatibility layer was stripped out a few months back. Currently, they are gearing up to get it officially released. I have no complaints with it. But using it, I do have to implement some things myself that Allegro has built-in, or available as an addon.
Having PhysicsFS already wrapped into Allegro is a time saver in itself. Plus the fonts work (I never got SDL_ttf to work under SDL 1.2).

That said I probably would have gone with SDL 2.0 due to my familiarity with SDL 1.2 if it wasn't for their Mercurial repositories being down when I went to check it out. I'm kind of glad they were, because Allegro 5 looks slightly more my style.
I've been using Allegro since version 4, but I did try SFML until I realized the version I was using had memory leak issues (latest version at the time - well known issue). Allegro 5 has been able to do everything I've wanted in my projects with little hassle! :) Never got into SDL though, mainly because Allegro has helped me achieve my project goals.

In Allegro 4 I had to add in zlib for png use sadly, as it was not included.

June 2016 »

2627 28 2930  

Recent Entries

Recent Comments

Recent Entries

Recent Comments