Which graphic library recommend for make 2D games?

Started by
4 comments, last by impulse9 13 years, 9 months ago
Hello everyone.

I been talking with maspeir about the best graphic library for make 2D Games like asteroids, tetris, horizontal scrolling games and the other games of this kind.

I been reading the book Game Programming All In One where they used Allegro for explain everything, but maspeir make me wonder that in this moment DirectX and OpenGL could help me in this purpose because the power of this library with the graphics cards available in this days.

So I ask to anyone that could give me a advice, it's really good learn Allegro/SDL for 2D games or maybe it's better learn DirectX and OpenGL for that?

PD: I know there are a lot of topics about this, but this topics have a lot of time inactive, and maybe the time change the persepctive of many people.

Thank you.
Oscar Daniel Olarte Fuentes
Game Developer
Advertisement
You can try SFML. It uses OpenGL under the hood, but it's easier to use.
(As a request from maspeir from your recent thread I chime in here[smile])
Quote:it's really good learn Allegro/SDL for 2D...


I had a look at Allegro and I second maspeirs opinion: This is really old-school 2D rendering in software. Of course this has the advantage to be able to run on very old hardware, but if you want to take advantage of hardware graphics and/or "newer" features like shaders, there's no way around DirectX/OpenGL.

Whether its appropriate to go directly DirectX/OpenGL or use an intermediate layer is yours to choose. If you are willing to learn a lot (and a long time) then go there.

You haven't specified what platform you are targeting. If you target Windows/Linux, that SFML looks fine. Or maybe SDL or Ogre. Can't help you there since I use DirectX through C#/SlimDX (2D by the way).

If you can consider using another language - I think you're using C now - you could make your life probably even easier. The ever returning question in the beginner forum "what should I use first" is mostly answered with C#/XNA or pygame. For 2D there's also Flash.

And judging from your recent thread the library you chose should not only rely on the question "can/should I take advantage of the hardware". A full blown (commercial) game engine comes with a tool chain which eases creating content and wiring it to your code. Think about that, too.

unbird


PS @maspeir: Can't find that thread right now, but, yeah, someone recently stated there's actually no (newer) book on 2D game programming.
I believe that Kanji is the best 2D game framework for desktop deployable commercial games. At least, it is the most widely used in the casual game industry. It's built on the interfaces of the now-dead PTK (also used in lots of commercial games.)

Has fallback support to DX 8.1 and supports DX9, OpenGL, and OpenGL ES. Deployable on Windows XP/Vista/7, Mac OSX, iPad and iPhone. Supports pixel shaders, Ogg Theora/Vorbis, and lots of other nice stuff.

http://kanjiengine.com/cms/
My personal recommendation is that you skip pre-made libraries and write your own in either DriectX or OpenGL. It really is not a hard task to do. I recommend this over a library for the simple fact that you do not know OpenGL or DirectX and that really is not a good thing.

All of the libraries mentioned to this point will suit you well, even Allegro. Allegro is based on OpenGL, so it is hardware accelerated. Still, there is something to be said for understanding what is going on under the hood. If all you know is how to integrate a library into your code, you'll never be able to go beyond that library or to tell when the library is not functioning correctly.

If I were to use a library for this purpose, it would be for the sole purpose of laziness. Basically I would be using it because I don't want to write my own game engine, NOT that I don't know how.

As I stated in your other thread, go to the OpenGL and/or DirectX forums here and start asking questions. But first, make a determination of which API you'll want to use. If you will only develop for Windows, go with DirectX. If you plan on porting to the Mac, iPhone, iPad or Linux, go with OpenGL.

No, I am not a professional programmer. I'm just a hobbyist having fun...

I'd choose Allegro. It's simple (beginner-friendly), supports a variety of languages, has a huge and friendly community that's supportive of newcommers (#allegro channel on irc.freenode.org will quite possibly solve any troubles you might have, not to mention a well written help with examples for every function) and best of all it's cross platform so you may choose pretty much any known OS. It's quite an old library but it's being updated all the time.

I'd definitely recommend Allegro for the first dive in the gamedev world. Eventually, you will move on anyway and you might learn a thing or two in the process.

This topic is closed to new replies.

Advertisement