Game programming basic questions?
Hi,
i review a lot of forums dedicated to gaming, but i need info how to do it using QT.
1.The difference in using QPaint and OpenGL?
2.What is the best approach if i want to make a game using raster graphic for example game like BigFishgames with background and another
pictures that move around?
3.Is OpenGL only for vector graphic?
4.Some examples of simple game made with QT?
Thanks in advance
Re: Game programming basic questions?
OpenGL is an API to produce 2D or 3D graphics while QPaint* classes are used to draw something in your application whether it's a widget or something else. If you want to create a classic 2D game I would suggest SDL, a lot simpler than OpenGL api (that doesn't mean you can't do it with Qt :p ).
Some examples
Tetris using QtScript-> Script Tetrix Example
Tetris using Qpaint* classes (Qt 4.3 doc)-> Tetrix Example
Asteroids using graphics view framework-> Ported Asteroids Example
Examples with openGL(not games but it'll give you and idea)-> http://doc.trolltech.com/4.6/examples-opengl.html
Re: Game programming basic questions?
Re: Game programming basic questions?
Quote:
Originally Posted by
unix7777
1.The difference in using QPaint and OpenGL?
QPainter is a painting frontend, OpenGL is a painting backend that can be used by QPainter.
Quote:
2.What is the best approach if i want to make a game using raster graphic for example game like BigFishgames with background and another
pictures that move around?
Probably QGraphicsView.
Quote:
3.Is OpenGL only for vector graphic?
Well.... in general yes. You can do raster graphics with it using shaders or keeping sprites as textures and manipulating rectangles but I wouldn't call it straightforward (but essentially if you use QPainter with OpenGL backend that's what you get).
Quote:
4.Some examples of simple game made with QT?
There are some in Qt docs, there is Google Earth... ups... that's not a game..., also "WolfenQt" (it's on Qt Labs) is a nice example of what you can do with Qt.