This is a discussion on SDL vs. Allegro ( Which is better for screen graphics, keystrokes, and maybe sound ) within the Tech Board forums, part of the Community Boards category; Hello. I have been thinking about learning more about Allegro or SDL. I have already used SDL before and have ...

Hello. I have been thinking about learning more about Allegro or SDL. I have already used SDL before and have it installed, but before I went any further, I wanted to know if it was the right choice for handling what I mentioned in the title. I have a book that brushes briefly on Allegro, and it didn't look too awfully hard. It showed me how I would create some graphics and handle events, and I understood it fine by reading it. My main question is which is better for handling the things mentioned in the title. Graphics and keystrokes are most important to me, sound I don't care as much about.

They both provide similar features, allegro has a few extras that SDL may not support (or may require plugins/additional SDL libraries to support). That being said however, I would say SDL is more prevalent and there is probably more documentation/tutorials online.

If portability is your main goal I would personally go with SDL but these days they're really close on that level. Otherwise it really doesn't matter.

Edit: forgot to mention that this post is off-topic for this forum, perhaps a mod can move it to the appropriate graphics/game programming section.

SDL has a cleaner design in my opinion, especially the newly released SDL2.
Also if you are doing something sophisticated with the graphics, consider using OpenGL on top of these libraries.
That way, you can, in theory, transition between them with minimal change in your main code.

Manasij Mukherjee | gcc-4.9.2 @Arch Linux Slow and Steady wins the race... if and only if :1.None of the other participants are fast and steady.
2.The fast and unsteady suddenly falls asleep while running !

I'd recommend SDL, personally. If you're going to start now, start on SDL2 and save yourself a lot of hassle. In the past, I've actually found it easier to convert Allegro apps to use SDL rather than go through the hassle of locating / compiling Allegro libraries for certain platforms.

In terms of other platforms, I find cross-compiling SDL and its associated libraries much easier. Which is probably why it tends to be the first framework that appears for new platforms when people start coding for them.

- Compiler warnings are like "Bridge Out Ahead" warnings. DON'T just ignore them.
- A compiler error is something SO stupid that the compiler genuinely can't carry on with its job. A compiler warning is the compiler saying "Well, that's bloody stupid but if you WANT to ignore me..." and carrying on.
- The best debugging tool in the world is a bunch of printf()'s for everything important around the bits you think might be wrong.