PDA

View Full Version : QGraphicsView and game programming



ball
20th August 2006, 12:38
Is anybody here knows that the new QGraphicsView class are fast enough to be using on game programming? Thanks.

grosem
20th August 2006, 12:45
What kind of game do you mean?

jacek
20th August 2006, 13:10
What kind of game do you mean?
Good question, because it's surely fast enough for go or solitaire ;)

Brandybuck
20th August 2006, 19:30
It is fast enough for sprite and tile based games. Think civilization, simcity, etc. One of the demos Trolltech provides is asteroids. If you're worried about frames per second, stick with OpenGL and use a QGLWidget. Otherwise QGraphicsView should work for most non-frenetic games.

ball
21st August 2006, 03:45
How about some game like Final Fantasy VII? It is 2-D in map which mixed with 3-D object and character, and is totally 3-D in battle scene.

Bitto
9th January 2007, 21:14
It's fast enough for flat 2D games with mixed-in 3D characters as long as you don't transform the view. The background will be cached, and QGraphicsView will basically blit it over at close-to-no cost, but with several layers of 2D graphics (like you typically have in FF7/8 or all the old Sierra games), transforming the view will perform pretty bad on X11, and only slightly bad on the other platforms. I hope QGraphicsView will support general cacheing of items too in the future (QGraphicsSvgItem already does), but as for now the items need to be re-rendered and re-transformed for each expose.