• Advertisement
Sign in to follow this  

SDL or Allegro?

This topic is 4335 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok so I have gotten pretty good with using GDI to make a sprite engine and writing a small little shoot em up with it. I want to move on to bigger and better things though, and I am particularly interested in something that is cross-platform whcih is why I am not using DirectDraw. So I now have two questions 1. What is better SDL or Allegro? IE which has better features and is easier to code with? 2. Which is better for making a crossplatform game? SDL or Allegro? Or are they both just as good when it comes to cross platform games?

Share this post


Link to post
Share on other sites
Advertisement
Well. I'm using SDL, its very easy to code with and very powerful. Its very popular in linux game programming, you can find a lot of examples, games, tutorials, books, etc. Don't know about allegro but I like SDL and really don't want to try another library.

Share this post


Link to post
Share on other sites
I've tried both, but I prefer SDL myself. I recommend you try them both out as well. Probably just comes down to personal taste with something like that. They both have a lot going for them.

Share this post


Link to post
Share on other sites
I should add, which one has better networking code? I plan on making my next game networked.

And yes its going to be an MMORPG :-P (no, not really)

Share this post


Link to post
Share on other sites
Quote:
Original post by Cubed3
I should add, which one has better networking code? I plan on making my next game networked.

And yes its going to be an MMORPG :-P (no, not really)


SDL has no networking. Well... it does with the extension SDL_net, but SDL_net sucks a huge one.

Just use an additional library like HawkNL.

Share this post


Link to post
Share on other sites
Quote:
Original post by Cubed3
I should add, which one has better networking code? I plan on making my next game networked.

And yes its going to be an MMORPG :-P (no, not really)


i've heard many good things about raknet, but i've never tried it myself.

Share this post


Link to post
Share on other sites
I'm gonna give a vote to SDL. Doesn't take long to set things up and you can program graphics in very little time.

Share this post


Link to post
Share on other sites
I haven't tried Allegro, but my impression is that it would be quicker to do sprite-based games, whereas SDL can be used with it's graphics API or later changed to OpenGL for advanced 2D or 3D graphics. It's what I use and recommend.

Share this post


Link to post
Share on other sites
I never used SDL, but my expierience with allegro are as follows. Very easy to learn and to create sprite based games. But it graphical capabilites are very limited if compared to direct draw. I do not recommend allegro for big projects, only for very small one-programmer games.

Share this post


Link to post
Share on other sites
It really doesn't matter which library you choose as they both have their pros and cons. People can argue both ways and not really accomplish anything in the end.

What I suggest you try doing is making a simple application in either SDL or Allegro (you choose one), and then try doing the same thing using the other API. Which one seems more natural to you? Which one do you find has nicer documentation to work with? Which one is a better stepping stone to more complex APIs like Direct3D or OpenGL? Whatever you choose doesn't really matter as they can both pretty much accomplish the same thing, just in a different manner.

Share this post


Link to post
Share on other sites
I've used both for simple programs, and I feel Allegro is more intuitive and includes more functions (in the "default installation"). But it'd be a good idea to try something simple using both libraries, they're really simple (to start working with) and similar, so it won't take you so long :).

Another comment about 3D: both can be used along with OpenGL (in Allegro you need the AllegroGL extension), but I haven't tried them myself so I can't comment about it (I'd make a search on how AllegroGL works).

Best wishes,
José Jorge (Geo).

Share this post


Link to post
Share on other sites
I would take a look at ClanLib. ClanLib is a higher-level API for 2d graphics with both OpenGL (for very fast 2d) and SDL (for fallback) backends. It does all sorts of stuff from resources (XML description files, and loading from zip files), proper collision detection (automatic collision detection from sprites, even works when rotated or scaled), GUI, sound, network and signals and slots.

It also makes good use of C++'s features, which makes things pretty easy to work with. For example, once you connect a signal to a slot, it returns a CL_Slot object. Once it goes out of scope, the connection is broken. Scope is used quite a bit for things like this. Don't worry about de-initialization code, the destructors handle that. To init ClanLib, just declare a new object that does it for you, and reverses the process when it goes out of scope.

It's also portable, which you mentioned needing.

On a side note, why don't people use ClanLib? I see a lot of talk about SDL (rather low-level and.. well, slow), and Allegro (rather.. archaic), but almost never ClanLib.

Share this post


Link to post
Share on other sites
Quote:
Original post by jonahrowley
On a side note, why don't people use ClanLib? I see a lot of talk about SDL (rather low-level and.. well, slow), and Allegro (rather.. archaic), but almost never ClanLib.


Check out http://www.clanlib.org

Best wishes,
José Jorge (GeoMX).

Share this post


Link to post
Share on other sites
Quote:
Original post by GeoMX
Quote:
Original post by jonahrowley
On a side note, why don't people use ClanLib? I see a lot of talk about SDL (rather low-level and.. well, slow), and Allegro (rather.. archaic), but almost never ClanLib.


Check out http://www.clanlib.org


Oops, horrible timing. The domain name looks like it lapsed, but the ClanLib site is very alive.

Share this post


Link to post
Share on other sites
I would suggest you try openlayer.

"OpenLayer is a hardware accelerated 2D Graphics library. It specifies a new api to be used alongside of Allegro and takes control of how the contents of the screen are rendered and uses OpenGL functions through AllegroGL to allow hardware acceleration."

As fast and intuitive as it gets! You get to learn OpenGL, too.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I've ported an old SVGAlib project to both SDL and Allegro, and I have to say that allegro was much easier to work with. SDL is lacking in drawing primitives, and I remember having to code some myself. Of course, if you're only working with bitmaps, then you'll be fine with SDL, but if you need drawing functions, SDL won't cut it.

But they do have slightly different purposes. SDL is supposed to be a thin abstraction layer over the hardware to allow portability, and Allegro is meant to be a more complete game toolkit. In my ideal world, Allegro would have an SDL backeng target available. This would allow the greater ease of use of allegro with the greater portability of SDL.

Share this post


Link to post
Share on other sites
Quote:
Original post by jonahrowley
Oops, horrible timing. The domain name looks like it lapsed, but the ClanLib site is very alive.

Well, it seems it's online now (the domain), I'll try to have a look at ClanLib in the near future, it seems it lets you target SDL or OpenGL for graphics, but I don't know if it uses SDL for other purposes (audio, input, networking...).

Quote:

I've ported an old SVGAlib project to both SDL and Allegro, and I have to say that allegro was much easier to work with. SDL is lacking in drawing primitives, and I remember having to code some myself. Of course, if you're only working with bitmaps, then you'll be fine with SDL, but if you need drawing functions, SDL won't cut it.

But they do have slightly different purposes. SDL is supposed to be a thin abstraction layer over the hardware to allow portability, and Allegro is meant to be a more complete game toolkit. In my ideal world, Allegro would have an SDL backeng target available. This would allow the greater ease of use of allegro with the greater portability of SDL.


Well, Allegro runs on DOS, Unix (Linux, FreeBSD, Irix, Solaris), Windows, QNX, BeOS and MacOS X, that's great portability.

And yes, as I mentioned, when using both "you feel" that Allegro is "more complete" since it includes some more functions (like the ones you mention for drawing primitives), but with SDL you don't need to code them yourself since there are some extra libraries provided by other (meaning not the authors of SDL) people like SDL_gfx or SDL_Draw.

Regards,
José J. Enríquez R.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If documentation is your concern then I recommend Allegro as the book 'Game Programming all In One - 2nd Edition' covers Allegro programming for start to finish.

I don't know of any similar books covering SDL.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement