SDL or Allegro?

Member
Posts: 53
Joined: 2006.10
Post: #1
Hi,

I'm on chapter 13 now of Focus on SDL and i still can't make a game in it...just some sounds and images (which I could already do with wxWidgets..and actually wxWidgets works on all of them and I can't get the sound samples to run in my linux and i settled for compiling SDL_image on my mac without jpg and tiff ... so so far i can do a lot more of the same stuff in wxWidgets even easier and more reliable)...and i'm wondering now if maybe SDL isn't the right choice -.-

Is Allegro as easy to learn? I like their license giftware Smile Also their community looks a lot bigger or i just don't know where the SDL people go?

What about Clanlib? Is it as easy to use as SDL? Their site isn't as confidence inspiring as Allegro or SDL...appears more alpha to me..if that makes sense.

SDL isn't so hard after all. i wish their were more (and better) SDL only books though.

Also i'm getting the impression so far that SDL is just a basic library that other libraries create on top of, so should i be learning Allegro next or Clanlib? Or is SDL good enough to make 2D games on it's own? Which i'd prefer because I don't want to learn everything forever i'll never get anything made Cry I spent the better half of last month learning encryption... Mad Wacko Blink
Quote this message in a reply
Luminary
Posts: 5,125
Joined: 2002.04
Post: #2
In my opinion: SDL gives you a window and events, and OpenGL gives you graphics. Everything else in SDL is a waste of time. The window and events bits are pretty OK, as these things go.

Don't make things more difficult for yourself than they need be. Dive in, copy some example code, and get something running. Reading is all well and good, but doesn't get programs built.
Quote this message in a reply
Member
Posts: 749
Joined: 2003.01
Post: #3
encryption? Blink you'll probably never need that...

I used allegro for a while I dont like it now, it's too oldschool (no hardware acceleration, 256 colors...). Sure they have a big community though.

As soon as you know how to display *any* graphics (with SDL like, i dont know, draw a square) you can (and imo should) start making a game, to get confortable with the game logic, which is the most important thing. Tou'll be surprised how many cool games you can make with squares (or balls) only Wink

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Sage
Posts: 1,478
Joined: 2002.09
Post: #4
I'd have to agree with OSC. SDL is a nice easy cross-platform way to open windows and use events, but not much else. Use it to open an OpenGL context, and work from there.

OpenGL has only a slightly higher learning curve than SDL's drawing commands, but is far more powerful and faster. I would expect this to pay off rather quickly due to the difficulty of making even moderately fast games with SDL's drawing functions.

For my projects, I use SDL for windowing/events, OpenGL for drawing, OpenAL for sound, libVorbis for sound loading, and libPNG/libJPEG for image loading. You would probably want to substitute SDL/SDL_mixer for OpenAL/Vorbis. That would save you a bit of trouble. Don't use SDL_image for loading OpenGL textures. I used to do it, but it was slow and gross. Just ask someone for their PNG/JPEG loading code.

There should be an SDL/OpenGL Application template in XCode if you installed SDL the usual way.

My experience with Allegro is that it isn't as well supported on OSX. That's my 2 cents.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Apprentice
Posts: 6
Joined: 2007.03
Post: #5
hi, I'm interested in this question too
but I'm only interested in very simple graphics
-what I'd like to make, is a sort of text-based game with some colour pictures and diagrams and perhaps the odd beeping noise.

I've been learning a bit of SDL just so I can draw shapes in different colours and things, but do you think it would be more worthwhile/simple to learn allegro instead then? or opengl?

my other question is though, say I've drawn some pictures and things,
how can I then display text and ask for user input etc
in the normal cin>> cout<< type of way? doesn't seem to work so far

that would be VERY helpful! thanks a lot
Henry
Quote this message in a reply
Member
Posts: 244
Joined: 2005.11
Post: #6
hellohenry Wrote:how can I then display text and ask for user input etc
in the normal cin>> cout<< type of way? doesn't seem to work so far
That works fine if you build a terminal application (when you build in Xcode it will use the log window). You have to use the std namespace (either by typing std::cin etc every time or by typing "using namespace std;" at the top).
If all you want to display is a few still images, you could just draw them in Photoshop (or whatever) and display them with a few calls to Quicktime, ImageIO or your image library of choice.
There's loads of examples for basic image loading and display on the web already. Quite a few on this forum infact.
Quote this message in a reply
Moderator
Posts: 675
Joined: 2002.04
Post: #7
@hellohenry: the usual reason given for the preference of using OpenGL in games, rather than just using SDL, is speed; however, given the type of game you are describing, OpenGL would likely be overkill.

I don't believe it is possible to use the standard library console I/O functions in SDL (somebody else can probably confirm); what I have done in the past is create a character buffer, and during the game loop place any characters entered (SDL_KEYDOWN events) into that buffer; when the SDL_KEYDOWN event tries to place a SDLK_RETURN character into that buffer, parse the buffer as you would the string resulting from scanf/cin/etc.

Mark Bishop
Quote this message in a reply
Apprentice
Posts: 6
Joined: 2007.03
Post: #8
hi, thanks,
ok, what about allegro?
does that allow you use to draw lines and such in between ouputting standard text?
or, change text colour? what is the most simple way to change text colour using xcode, c++ etc?
thanks
henry
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Porting help with allegro mongrol 6 4,655 Dec 10, 2007 05:30 PM
Last Post: mongrol
  Installing Allegro Nick 5 4,014 Aug 4, 2004 12:17 PM
Last Post: IBethune