views:

1206

answers:

7

Hi everyone,

I have to code a Pac-Man clone in C++ for a school project, and I'm hesitating between SDL and Qt for the graphical implementation.

I have already a little experience with SDL, but I wanted to give Qt a try. I was asking myself if it is "technically" realisable and if Qt is a good choice for that. I know that it have an animation framework in it, but I wanted to hear from your experiences.

To summarize: is Qt a good framework for making games ?

Thank you.

+4  A: 

To summarize: is Qt a good framework for making games ?

YES.

You can take a look at the games made using it.

codaddict
+1  A: 

Both of those libraries will be fine if you spend the time learning how to use them. However there are plenty of other great libraries to consider such as SFML, so you should consider having a look at them, it could save you quite a bit of development time (especially since SDL in written in C and therefore doesn't fit into the C++ OOP model so well - a C++ library might make life easier).

Stephen Cross
Regarding SFML: any library whose last news is more than half a year old, and is "looking for someone to maintain the Mac port" doesn't look so good :)
FX
The project is very much active as evidenced by the latest SVN updates and forum posts. The release cycles are about every 6 months (as can be seen: http://www.sfml-dev.org/forum/viewtopic.php?t=76 ) so the next version should be released soon.
Stephen Cross
I didn't say it's a bad library; I say on first view, it doesn't look to promising.
FX
+19  A: 

Qt's main qualities as a cross-platform GUI development architecture (for games and for other types of applications) are (in my opinion):

  • it's rather simple to learn
  • it has a large, good community (both on the mailing-lists and here on SO)
  • it has an animation framework that is simple and powerful (here for the doc); Qt comes with examples that are really helpful in starting developing code
  • it's really cross-platform, i.e. it usually works safely for all platforms, but still lets you tweak it if you need to, to access platform-specific goodies
FX
besides, QT will look great in your CV
lhahne
Qt is not "simple" but worth investing. I tried both SDL and Qt last year and from that moment used Qt for every project that needs GUI and cross-platform availability :)
Viet
If you don't like the QGraphicsScene strucutre, Qt still allows you to do it in pure OpenGL including GLSL.
penguinpower
+3  A: 

SDL and QT will both work fine for making cross platform games. However, with SDL, you don't have as much control over the window from a cross platform mechanism. For instance, the window you create has no menu bar. To create a menu bar you need to delve into non-cross platform code. The SDL window struct has the information you need to create the menu bar, but the way you would do it is different on Windows and a *nix system.

With Qt, you can do it all without worrying about the platform specifics. In essense, the difference is that SDL was created as an abstraction to facilitate in making full screen games, while Qt was created as an abstraction for creating cross platform GUI based applications.

Casey
+1  A: 

Thank to all of you, I will use Qt :)

Pym
Well, you know where to ask your questions along the learning path!
FX
+3  A: 

Neither Qt or SDL is a good choice for making simple 2D games in C++, IMHO.
SFML is the way.

Thomas Petit
Upvoted because I hadn't heard of SFML, and it looks interesting. I add the caveat that I learned a lot about game programming and abstraction by using SDL, specifically because of its low-level nature.
Merlyn Morgan-Graham
I think the SFML project goal is to be for C++ what SDL is for C.I discovered it at the last Global Game Jam convention (bunch of people gather and try to make a game in 48h) The team who picked SFML didn't know it in the first place. They quickly ran trough the tutorials on SFML website and 2 or 3 hours later, they were making the game. I also didn't see them during the 48h bumped into horrible problem or limitation due to SFML. Well, they were in trouble concerning the logic of the game itself, the game design, the art... etc. the usual stuff :)
Thomas Petit
+2  A: 

SDL and QT will both work fine for making cross platform games. However, with SDL, you don't have as much control over the window from a cross platform mechanism. For instance, the window you create has no menu bar. To create a menu bar you need to delve into non-cross platform code. The SDL window struct has the information you need to create the menu bar, but the way you would do it is different on Windows and a *nix system.

Not true, the sdl iphone port was flawed all the necessary code is there to successfully interface between the uikit and sdl but the implementation was flawed, I sucessfully create iphone apps with full acess to the sdk, just check the official sdl blog there's about half dozen posts. All you need to do is get hold of the app delegate and add a few simple interfaces. I plan to do a complete blog this weekend.

I haven't tried qt or sml because I found sdl to be good enough

michelle