Yannick
Member
Some interesting links, to show why i am so enthusiastic about this.
All this applies to Qt 4.6, this is the current stable release
For who is this thread?
Glossary
GameObject: ingame representation of a thing (a tank, an NPC)
GameEvent: something that happens in your game universe (tank shoots, talk to NPC)
Qt differences with *regular* C++
Similar to C# classes that always inherit from Object, Qt provides Signals/Slots and Runtime Type Information for classes that inherit from QObject
QObject derived classes support parent/child relations
Signals/Slots mean that function caller/callee connections can be decided at runtime
Runtime type information means, you can query the properties of an object at runtime
Signal / Slot documentation
Basic runtime type information properties documentation
QObject tree documentation
How is this useful for games?
GameObjects tend to be organized in parent/child relations. Setting properties of GameObjects and connection their GameEvents is a very common feature while loading levels, this maps directly to QObject derived classes and can be acomplished with a minimum of code.
The Graphics View Framework
This is the Qt technology that will render your game to the screen. It was originally intended as a way to make free-form UI widgets, overtime so much optimizations have been made it is now perfect for writing entire games. It supports software rendering, OpenGL ES2 and OpenGL2 where applicable on every platform. If needed, you can still talk directly to OpenGL.
Graphics View Documentation
How is this useful for games?
This is for all intents and purposes a full featured 2.5D hardware accelerated scenegraph.
Crossplatform
With some carefull coding around filepaths and constants, your code will compile without modifications on the folowing platforms:
Mac
Linux
Windows
Windows Mobile
S60v5
Show me some code then
Colliding Mice this is the simplest example of how you would organize your code for a game
Asteroids an actual game written in Qt
Sub Attack A more complicated Qt game, using some technologies i haven't talked about yet (Animation and State Machines)
Boxes Demonstration for achieving 2.5D
Interesting reads for advanced users
Some QT labs blogpost i found very interesting:
http://labs.trolltech.com/blogs/2010/01/06/qt-graphics-and-performance-opengl/
http://labs.trolltech.com/blogs/2009/03/13/using-hardware-acceleration-for-graphics
http://labs.trolltech.com/blogs/2010/01/11/qt-graphics-and-performance-the-cost-of-convenience/
http://labs.trolltech.com/blogs/2010/06/29/fun-things-you-can-do-with-the-nokia-qt-sdk/
A video to wet your appetite
This uses Box2D + Tiled Editor + Qt Mobility (for calculating the direction of gravity on the phone)
https://www.youtube.com/embed/QI8xIZqlVtI?feature=oembed
I am going to edit this post as i come across other cool stuff
All this applies to Qt 4.6, this is the current stable release
For who is this thread?
- You know the very basics of C++
- C# / Java programmers that feel like something is missing in C++
- You might have done a game/demo in another game library like SDL
- You might have some experience with regular Qt apps and want to try making a game
Glossary
GameObject: ingame representation of a thing (a tank, an NPC)
GameEvent: something that happens in your game universe (tank shoots, talk to NPC)
Qt differences with *regular* C++
Similar to C# classes that always inherit from Object, Qt provides Signals/Slots and Runtime Type Information for classes that inherit from QObject
QObject derived classes support parent/child relations
Signals/Slots mean that function caller/callee connections can be decided at runtime
Runtime type information means, you can query the properties of an object at runtime
Signal / Slot documentation
Basic runtime type information properties documentation
QObject tree documentation
How is this useful for games?
GameObjects tend to be organized in parent/child relations. Setting properties of GameObjects and connection their GameEvents is a very common feature while loading levels, this maps directly to QObject derived classes and can be acomplished with a minimum of code.
The Graphics View Framework
This is the Qt technology that will render your game to the screen. It was originally intended as a way to make free-form UI widgets, overtime so much optimizations have been made it is now perfect for writing entire games. It supports software rendering, OpenGL ES2 and OpenGL2 where applicable on every platform. If needed, you can still talk directly to OpenGL.
Graphics View Documentation
How is this useful for games?
This is for all intents and purposes a full featured 2.5D hardware accelerated scenegraph.
Crossplatform
With some carefull coding around filepaths and constants, your code will compile without modifications on the folowing platforms:
Mac
Linux
Windows
Windows Mobile
S60v5
Show me some code then
Colliding Mice this is the simplest example of how you would organize your code for a game
Asteroids an actual game written in Qt
Sub Attack A more complicated Qt game, using some technologies i haven't talked about yet (Animation and State Machines)
Boxes Demonstration for achieving 2.5D
Interesting reads for advanced users
Some QT labs blogpost i found very interesting:
http://labs.trolltech.com/blogs/2010/01/06/qt-graphics-and-performance-opengl/
http://labs.trolltech.com/blogs/2009/03/13/using-hardware-acceleration-for-graphics
http://labs.trolltech.com/blogs/2010/01/11/qt-graphics-and-performance-the-cost-of-convenience/
http://labs.trolltech.com/blogs/2010/06/29/fun-things-you-can-do-with-the-nokia-qt-sdk/
A video to wet your appetite
This uses Box2D + Tiled Editor + Qt Mobility (for calculating the direction of gravity on the phone)
https://www.youtube.com/embed/QI8xIZqlVtI?feature=oembed
I am going to edit this post as i come across other cool stuff
Last edited by a moderator: