Allegro vs SDL

Started by
16 comments, last by rip-off 17 years, 4 months ago
I've read through various descriptions and the respective home pages, however, I'm not getting a feel for distinguishing between these two. When would you choose one over the other? The best I've come up with is that SDL is (more or less) cross-platform DirectX, while Allegro isn't as extensive but encapsulates more of the game-specific types such as sprites, collision detections, etc. Am I even close? -Kirk
Advertisement
What are you trying to make? I think SDL is a lighter library and is great to use with OpenGL, and SDL has several 'extensions' where as with allegro they build everything in.

It is also a matter of preference, I prefer SDL's PREFIX_CamelCase() coding style better than the long_function_name() style.



I'm getting close to closing these topics on sight. In fact, I feel a bit dirty for not already having done so. Allegro vs. SDL feels almost as played out as OpenGL vs. DirectX. [razz]

Anyway, I think Allegro and SDL are equally cross-platform. And Allegro does no built-in collision detection and "sprites" beyond normal bitmaps. I've not had a chance to try SDL, but I get the impression Allegro is a bit higher level (whether that's good or bad depends on you). But to be honest, if you know little enough about SDL and Allegro to even ask the question, flipping a coin and picking one is probably your best option. They're equally capable in the long run.

I'll say it again; if you have to ask the question, you're in a place where either one is fine for learning to program and you should just pick one and be done with it. Besides, after learning one, the other will be even easier to learn. Just pick the one you feel most comfortable with using and it'll work.

Jesus saves ... the rest of you take 2d4 fire damage.

Thanks for the explanations.

I apologize for asking a question that has burned a hole in your screen. I certainly did search the forums, Google for the topics, and read through the respective home pages. At that point I came to the conclusion that essentially I couldn't determine a preference/difference for the two libraries - much what the answers sate. I thought I must have been missing something, hence my question.

Quote:Original post by kirkd
Thanks for the explanations.
At that point I came to the conclusion that essentially I couldn't determine a preference/difference for the two libraries

Right, and you won't without trying them. [smile] Good luck with whichever one you choose.

Jesus saves ... the rest of you take 2d4 fire damage.

Hmmm... It may not be a bad idea for me to say this... If you're not into the gaming business or is just a hobbyist like myself then you better choose allegro over SDL. Why? I think Allegro has a better learning curve. Before I tried using Allegro, I've struggled on reading over the internet for whatever library would help me make a game. And allegro have proven to make me productive overtime. I don't have to concentrate much on the technicalities such as how do I blit an image on the screen. I only have to focus on my game logic. Ofcourse, you have to be well-knowledeable about C/C++ to be able to make a fast, working game. But there's the beginners forums to help you with that. :)
We should never stop learning...
You should try both. Go through a few tutorials using both SDL and Allegro and see which one you find easier to use. How easy is it to draw a rectangle? How easy is it to display an image on the screen?
Rob Loach [Website] [Projects] [Contact]
I made my start on game programming with allegro and I was wondering if sdl was better and it's worth the effort to learn the new api. Thx to reading this thread I have things much clearer so I dont think u should delete this thread on sight but maybe u can make it sticky.
Quote:Original post by Anonymous Poster
I made my start on game programming with allegro and I was wondering if sdl was better and it's worth the effort to learn the new api.

Once you've learned one, you should be educated enough to skim the API of the other and make that decision yourself. Always good to keep learning anyway. [smile]

Jesus saves ... the rest of you take 2d4 fire damage.

SDL was originally intended as a cross-platform wrapper for DirectDraw with some input routines etc as well.

It has no useful graphics (software) rendering routines, no useful sound routines (e.g. mixing), and little by way of useful stuff typically needed.

Therefore, for making a software-rendered app, SDL must be combined with either other libraries, or your own routines to do useful things.

Allegro, on the other hand, provides a great variety of useful things:
- All types of software rendering, including polygons, circles, text, blending and sprites
- All these can rendering into system ram
- Input functions which are higher level
- Sound functions which include mixing
- Data loaders for useful formats (i.e. ones your editor might support)

----

So the comparison isn't really fair at all.

The problem I see is that people use SDL to set up an opengl context, then realise it's arse because they can't then use the software-rendering part of the library (such as exists).

But Allegro is waay more useful.

Neither Allegro nor SDL provide any "Game engine" type framework, object management, collision detection, level loaders etc.

Mark

This topic is closed to new replies.

Advertisement