Jump to content

  • Log In with Google      Sign In   
  • Create Account


Allegro vs SDL


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
17 replies to this topic

#1 kirkd   Members   -  Reputation: 505

Like
0Likes
Like

Posted 30 October 2006 - 09:15 AM

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

Sponsor:

#2 clayasaurus   Members   -  Reputation: 139

Like
0Likes
Like

Posted 30 October 2006 - 09:36 AM

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.





#3 23yrold3yrold   GDNet+   -  Reputation: 914

Like
0Likes
Like

Posted 30 October 2006 - 04:29 PM

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.

#4 kirkd   Members   -  Reputation: 505

Like
0Likes
Like

Posted 31 October 2006 - 11:15 AM

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.



#5 23yrold3yrold   GDNet+   -  Reputation: 914

Like
0Likes
Like

Posted 31 October 2006 - 03:15 PM

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.

#6 armond   Members   -  Reputation: 168

Like
0Likes
Like

Posted 15 November 2006 - 04:46 AM

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. :)

#7 Rob Loach   Moderators   -  Reputation: 1500

Like
0Likes
Like

Posted 16 November 2006 - 05:30 AM

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]

#8 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

0Likes

Posted 23 November 2006 - 08:01 AM

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.

#9 23yrold3yrold   GDNet+   -  Reputation: 914

Like
0Likes
Like

Posted 23 November 2006 - 09:36 AM

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.

#10 markr   Crossbones+   -  Reputation: 1653

Like
0Likes
Like

Posted 23 November 2006 - 11:13 AM

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

#11 samuraicrow   Members   -  Reputation: 325

Like
0Likes
Like

Posted 24 November 2006 - 07:32 AM

Just becuase SDL is split up into multiple libraries doesn't mean that SDL_mixer and SDL_draw libraries are inaccessible. It's just broken up into more pieces. Since some of the platforms I support only currently support static linking of SDL I prefer it that way.

Allegro is a slightly higher-level library in that it doesn't make you think so much about which library something comes from and so on. Simple Directmedia Layer is exactly that: a SIMPLE media layer that abstracts many of the concepts away from the libraries that they call.

Also, if you want to use OpenGL plotting functions from SDL, you'll need a wrapper for simple blitting functions as provided in glSDL or hxRender since the OpenGL context is a separate piece of code from the screen rendering code. In Allegro there is an OpenGL wrapper function called AllegroGL that is a wrapper for the Allegro Scene Render software renderer.

It is my hope that someday somebody (maybe me) will write a set of macros that will translate from one to the other or mutually translate them both into OpenGL primatives.

#12 Taymo   Members   -  Reputation: 122

Like
0Likes
Like

Posted 26 November 2006 - 06:49 PM

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

Mark

Yes, it does. I could show them too you if you want.

..anyways as long as there's a lib for some functionality for SDL, SDL has said functionality.




#13 23yrold3yrold   GDNet+   -  Reputation: 914

Like
0Likes
Like

Posted 26 November 2006 - 07:32 PM

Quote:
Original post by Taymo
..anyways as long as there's a lib for some functionality for SDL, SDL has said functionality.

Well, by that logic, every library can do everything, since there's always a library you can add [smile] ...

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

#14 Taymo   Members   -  Reputation: 122

Like
0Likes
Like

Posted 27 November 2006 - 04:51 PM

Quote:
Original post by 23yrold3yrold
Quote:
Original post by Taymo
..anyways as long as there's a lib for some functionality for SDL, SDL has said functionality.

Well, by that logic, every library can do everything, since there's always a library you can add [smile] ...

How so? I said "..as long as there's a lib.." not that there is alway a lib to add. Whatever, I'm probably not explaining my view correctly.


#15 23yrold3yrold   GDNet+   -  Reputation: 914

Like
0Likes
Like

Posted 28 November 2006 - 06:07 AM

Quote:
Original post by Taymo
How so? I said "..as long as there's a lib.." not that there is alway a lib to add. Whatever, I'm probably not explaining my view correctly.

If it doesn't come with SDL, you need to add the library to your project. Confirm/deny?

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

#16 rip-off   Moderators   -  Reputation: 7651

Like
0Likes
Like

Posted 28 November 2006 - 06:35 AM

I see SDL as being the set of libraries like SDL_ttf, SDL_net, SDL_gfx SDL_image etc.

But thats just me though. [smile]



#17 markr   Crossbones+   -  Reputation: 1653

Like
0Likes
Like

Posted 28 November 2006 - 06:56 AM

I tried to use SDL to make an entry in a short-deadline game compo. Needless to say, I spent a lot of time trying to get around SDL's shortcomings.

The problem with needing lots of extra add-on libraries, is that you have to obtain them and get them to build in all of your build environments- which in a 48hr compo is a big strain.

For example, I wanted my game to work on Windows, otherwise lots of people would be unable to play it- I was using SDL_ttf for text, but because of its idiotic build system I had to essentially hack the win32 makefile.

This would have been a bigger problem if I'd used more SDL_* libraries- each one has its own peculiar build environment and its own README which must be read.

Essentially I just prefer Allegro because it's "All under one roof".

Mark

#18 rip-off   Moderators   -  Reputation: 7651

Like
0Likes
Like

Posted 28 November 2006 - 07:12 AM

I never had to build SDL from source under windows. I just got the develeopement libraries and used them.

I haven't had any trouble with any of the SDL_* libraries except SDL_gfx, but I use opengl now so I don't need it.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS