OpenGL for simple graphical view?



  • Hi :)

    I'd like to write a little tetris fot training and i'm wondering wether i should use OpenGL for the graphical output or a standard QPainter.

    Is the Qt Support for OpenGL more than just hardwareacceleration for graphics?



  • I would use the QPainter approach unless you need something in 3D (hmmm 3D tetris?). I don't think that performance will be an issue using QPainter.



  • You can use QPainter on a QGLWidget, it can still offer a considerable boost.

    Alternatively, you can implement your own QQuickItem with custom geometry nodes and easily implement both 2d and 3d tetris elements by using standard openGL approaches towards constructing geometry.



  • Thanks to both of you:) i guess i will look into it, for now it should become 2d, but who knows how it may evolve^^ (im actually happy if get the 2d collision detection right ;))


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.