PDA

View Full Version : Qt and game development



kr1d
26th February 2013, 06:11
I have my simple 2D game engine that I wrote in java ( j2me ).
So I'm planning to use it on PC ( windows / linux ) and maybe on some handhelds.
What can Qt can provide in this context? I see only two ways: QGraphicsView and QtOpenGl.

Can somebody explain pros and cons about those two? (fast image manipulation, rotation, flickering?, 100% same code for every platform?)

ps: one of main things that I use: many png sprites with alpha channel.

sorry for my english.

lanz
26th February 2013, 06:43
QGraphicsView is good for vector graphics with good measure of user interaction, but it getting slow early (around thousand or so objects, but see 40000 chips example http://qt-project.org/doc/qt-4.8/demos-chip.html). It's strength in using qt's painter, that have lots of functionality already implemented (brushes, pens, affine transformations).

OpenGL is OpenGL on every platform, though qt has nice wrapper classes and solid integration with the rest of the framework.

Each way is 100% crossplatform (at least, I haven't bumped into issues).

As for your case, I think QtOpenGL suits it better (though take a look at Qt5/QtQuick, I haven't tried it yet, but they say they extensively use OpenGL and have good perf.)