Author Topic: ALLEGRO or SDL ?  (Read 5951 times)

0 Members and 1 Guest are viewing this topic.

pllaybuoy

  • Guest
ALLEGRO or SDL ?
« on: January 21, 2013, 01:53:03 pm »
I've configured both and find the basics of both of them fairly easy , so which one should I rather go with ?
or the other way around which one would you rather go with and 'why' ?

Offline namespace7

  • Sir
  • ***
  • Posts: 561
  • Cookies: 115
  • My Brother's Keeper
    • View Profile
Re: ALLEGRO or SDL ?
« Reply #1 on: January 21, 2013, 03:36:20 pm »
It depends what you really want to do.

Both are rather easy graphics libraries, but they have a few major differences.
For example, if you ever plan to incorporate 3D into your programs, then you should go with SDL because it has very good support for OpenGL, while allegro does not.
On the other hand, if you only intend making 2D graphics, then both allegro and SDL are capable of almost same things. SDL makes collision detection easier, and has some nice extensions to do sound, networking and other useful things. SDL also has more tutorials and books.

You see these are similar libraries with similar capabilities, and are both cross platform. Its very hard to say which is better, so it would be best for you to just write a few simple programs using both, and see which one you like more.

Personally, I would always go with SDL, because I like how it is written, and I like the OpenGL support which can be used to take your programs to the next level (even 2D programs might benefit from OpenGL features to add particle effects for example).
"A programmer’s greatest enemy isn’t the tools or the boss or the artists or the design or the legacy code or the third party code or the API or the OS. A programmer’s greatest enemy is getting stuck.
Therefore a crucial step to becoming a better programmer is learning how to avoid getting stuck, to recognize when you’re stuck, and to get unstuck." -Jeff Wofford

pllaybuoy

  • Guest
Re: ALLEGRO or SDL ?
« Reply #2 on: January 22, 2013, 01:15:50 pm »
It depends what you really want to do.

Both are rather easy graphics libraries, but they have a few major differences.
For example, if you ever plan to incorporate 3D into your programs, then you should go with SDL because it has very good support for OpenGL, while allegro does not.
On the other hand, if you only intend making 2D graphics, then both allegro and SDL are capable of almost same things. SDL makes collision detection easier, and has some nice extensions to do sound, networking and other useful things. SDL also has more tutorials and books.

You see these are similar libraries with similar capabilities, and are both cross platform. Its very hard to say which is better, so it would be best for you to just write a few simple programs using both, and see which one you like more.

Personally, I would always go with SDL, because I like how it is written, and I like the OpenGL support which can be used to take your programs to the next level (even 2D programs might benefit from OpenGL features to add particle effects for example).
Thanks for the response ,  I started with allegro with this book
"game programming in all in one 3rd edition" by jonathan
And almost everything is wrong , all the functions in this book are deprecated , they give errors and I have no idea what to do since there are not many books out there related to allegro , guess i should switch to SDL , can you please guide me with some good books to learn SDL ? Please make sure the book is not old like this one with the deprecated stuff
And what I Really want to do is creating 3d video games , as a matter of fact I can't dive directly in 3d sprite programming without knowing 2d game programming , so I guess learning 2d now is the only solution I have

The only SDL book I know is this
http://www.amazon.com/exec/obidos/ASIN/1592000304/ref=nosim/cboard-20

But it is nothing about game dev. its just about the library and it doesn't covers logics of game programming

ps you are welcome to mention any other library for game dev. you think is better to learn(For a beginner) instead of allegro/SDL but make sure those have books or uptodate tuts available
« Last Edit: January 22, 2013, 01:40:37 pm by pllaybuoy »

Offline namespace7

  • Sir
  • ***
  • Posts: 561
  • Cookies: 115
  • My Brother's Keeper
    • View Profile
Re: ALLEGRO or SDL ?
« Reply #3 on: January 22, 2013, 03:26:09 pm »
Graphics programming is NOT a beginner subject.
Unless you already can create good text based games, forget hard-coding graphical games. So first it would be good to have something like a text based adventure game under your belt before moving into the graphics land. 2D graphics is not too hard to do though as long as you already know C++ or what ever language you are using pretty well, AND have some programming experience by writing programs that take longer then a few days to write.

I would recommend starting with SDL. Its a good library. I don't know what book you can use to learn, but this is what I used:
http://www.amazon.com/Programming-Linux-Games-Loki-Software/dp/1886411492/ref=pd_sim_b_1

Also, try googling "SDL programming tutorials" or similar. Sometimes tutorials can be a good way to jump right into it.

This is one of the websites I used to learn it: http://www.lazyfoo.net/SDL_tutorials/
Once you understand how to make basic games like battlefield in SDL, you can learn the basics of openGL though it is much harder then SDL. After you can make some interesting games in SDL/OpenGL, and understand how graphics libraries work and how they are used to make games, you should check out some game libraries. There are a lot of them, like Ogre3D or irlicht, and can make your life MUCH MUCH easier. They have lots of common game/graphics programming functions/classes that you wont have to write yourself and hence save you tons of time. But to use them efficiently, you must know C++ very well, and also understand the technologies behind them. So in short, don't hurry anywhere. You have a lot of years before you to learn this stuff. Go one step at a time, don't try to run before you can walk. Go slow and steady and you will achieve a lot. Most people quit game programming a few weeks after starting because they are not patient and don't have enough willpower to force themselves to learn the boring or hard bits. Don't be one of them.

EDIT: by the way I might not respond to your next post as I am going away for around 2 months.
« Last Edit: January 22, 2013, 03:27:03 pm by namespace7 »
"A programmer’s greatest enemy isn’t the tools or the boss or the artists or the design or the legacy code or the third party code or the API or the OS. A programmer’s greatest enemy is getting stuck.
Therefore a crucial step to becoming a better programmer is learning how to avoid getting stuck, to recognize when you’re stuck, and to get unstuck." -Jeff Wofford

pllaybuoy

  • Guest
Re: ALLEGRO or SDL ?
« Reply #4 on: January 22, 2013, 05:03:17 pm »
Thanks a lot for the kind and detailed reply , and I started this because I was getting bored with all the CLI programming , agree that it is hard and I will have to really good to get into it , but well how worse can it get if I mess up ?
I have programmed text based games before , remember coding this RPG one where you choose from mage,warrior and archer and then they level up by experience points and learn spells and get their status updated(attack , defense , hp and mp(for mage))
so lets see what this has got :)