What game programming library should I use?

Hi guys,

I'm looking to develop cross-platform 2D games in the future, but I'm concerned about what game programming library I should focus on. I'm learning Allegro 5 now, but I'm contemplating whether to study Open GL instead... I would want my games to work on both PC and Mac(including their touch devices). Help please? Thanks!
This is the very field I have been studying. My advice is get the book OpenGL SuperBible 4th Edition. Do not get the 5th edition. Here is why, the 5th edition deals with version 3.3 of OpenGL and higher. However, operating systems like the MAC only can support UP TO 3.2 of OpenGL. You can verify this when you look up the specs for the newest OSX - Lion under the OpenGL support.

Most phone apps can support 2.1 and up too 3.1. In fact, my current Intel HD 3000 video card ( newest card from Intel [ Which sucks by the way ] ) can only support UP TO OpenGL 3.1.

So, since the SuperBible 4th Edition covers from 2.1 up to 3.0, that's the book to start out with. You can get it off of amazon.com. They have some cheap prices too. The source code to the book can be downloaded for free from the OpenGL website that promotes all the OpenGL books. Please, MAKE SURE you read the book before attempting to code. Its important and will save you time and frustration. Take it from a past frustrated person. lol

Also, you will need to know that there is a difference in GL in general. OpenGL is the main 2D graphics library that has 3D functions. OpenAL is for Audio. But you will also see where it says GLSL. GLSL is the OpenGL version of Shaders. Shaders is your biggest tool in gaming in general. More phone apps are starting to support it as well.

Just like OpenGL, Shaders have their own versions as well. I am currently studying GLSL 2.0. There is a book you can get for it, known as the Red Book in the OpenGL community ---> OpenGL Shading Language ( 2nd Edition ). This book works perfectly with the examples in the 4th edition SuperBible. Also, they have a 3rd Edition, I highly recommend you check it out too.

Another book to look at is : OpenGL(R) Programming Guide: The Official Guide to Learning OpenGL(R), Version 2.1 (6th Edition). The 7th edition is good too, however if your trying to stay within a certain way of programing with less confusion, I recommend to stick with 6th edition first until you know more of what your doing.

On top of all this, watch these videos on OpenGL. They DO work as I have personally tested them in Code::Blocks IF you setup C::B correctly. Most people use Visual Studio, but I like free tools. :)

http://www.videotutorialsrock.com

I found one glitch however in one line, but its easily fixable. If you have problems, let me know. But I have personally tested ALL his code out and everyone one of them worked.

Hope this info helped.

EDIT UPDATE : By the way, some will tell you to go with DirectX, however even though DirectX11 is FREAKING SWEET, it will only work on Microsoft Platforms such as Windows and Windows Phone Apps as well as the 360 Game console. It will not work on any other devices or Operating Systems. Although there are some projects out there that are trying to port it over to them, they are still not stable nor are working 100% yet. So I suggest to stick with ONE library API --> OpenGL, then move on to DirectX later once you get OpenGL under your belt. And the only reason I say to work with OpenGL is because it will run on just about any OS and phone device if they support the version of OpenGL your writing in. The OpenGL version is what is important here. However, no matter what you try, OpenGL will not work with the 360 game console though.

Last edited on
Wow. Thanks! Your post was really helpful. So 10 points to Open GL and 0 to Allegro huh? lol
Allegro 5 can work alongside OpenGL. But keep in mind, its not a graphics engine. And neither is OpenGL for that matter. They are both API's only. So since they are both API's you can use both of them alongside each other.

Personally, I would not get into Allegro, until you understand OpenGL first. But that's just my opinion. Also, it's a separate set of DLL's that people must install, or your installer must provide. OpenGL comes with your latest graphics card drivers already. Its built in. When you goto websites like NewEgg, and you look at graphics cards, you look at the specs, it tells you what version of DirectX and OpenGL is supported natively by default.

Example : the NVidia GeForce 560 Ti ( Fermi ) video card has a native support for DirectX 11 and OpenGL 4.1.

NOTE : You CAN update your OpenGL version by updating to the latest drivers. But thats ONLY if your card can support the newer functions. So lets say you have a Video card that has native support for 3.0. And you update the drivers to the latest, and now your OpenGL is version 3.3. That means your card will not support anything higher then 3.3 .. no matter what you do. This is why MAC OSX - Lion only supports 3.2. Their Operating System graphics driver is at its limit. This same principle applies to DirectX too. I am on Windows 7 x64 and I have the Intel HD 3000 video card. The drivers will not allow me to use the DirectX 11 library because the video card's limit is DirectX 9.0c.

Bottom line, Allegro is not a bad API at all, its all just a matter of preference when it comes down to it. I personally am trying to stick with one graphics API for now myself. Although, admittedly, Allegro has peeked my interest on a couple things here and there along the way, but it was nothing that OpenGL couldn't do.
Last edited on
@winwordexonar: Do you know of a tutorial for opengl for the latest xcode? i have scoured google and follow the instructions to a t but it won't give me the option of creating a project for it.

@nocrej: sorry for intruding, I just want to get a good graphics library working
If none of the tutorials are working it might be because your lacking the Glut.framework and OpenGL.framework. Start XCode, then create a new Cocoa project. Then add the libraries. IF your missing them, then you can use spotlight to find them.

Once you do that, then you use the include statement to include it and go from there.

#include <GLUT/glut.h>

Then from here you can watch any tutorial and follow their source code examples. I personally like the http://www.videotutorialsrock.com tutorials. And yes, in his code, you can see he supports MAC and Windows. His code is universal.

If you need to visually see how to install those libraries ( if you have them that is ) here is a youtube video :
http://www.youtube.com/watch?v=0oYyt5TWxps

-----------
By the way, one note for those who see info about Glut / Glut32 / FreeGlut -- freeGlut is for windows and Linux, and Glut is for Windows, Linux and MAC. The difference is, Glut / Glut32 is no longer being updated or worked on. So Apple has to update it themselves for their OSX. As for Windows / Linux users, they can just use FreeGlut as an alternative.
@Aramil of Exilia: No problem at all.
@WinwordExonar: Thanks again! I'll focus on OpenGL for now.
Topic archived. No new replies allowed.