Unsolved What's the difference between drawing using QPainter and OpenGL for 2D objects
-
what's the difference between a drawing using QPainter and OpenGL for 2D objects? speed difference?
-
Hi
yes openGL will use the GPU and QPainter will not. ( hardware acceleration=
So openGL can be faster. -
@mrjj if I don't have GPU, I mean both of them can only use CPU to render 2D shapes, any difference?
-
@student
Hi
openGL needs a GPU.
But lets say it was a software openGL render.
Then QPainter might be faster for some stuff. -
Hi
But what do you want to make?
The requirement for your app will tell if openGL or QPainter is the best choice.
Or maybe QML. -
@mrjj thanks for your reply. I am trying to develop a software which can render some 2D shapes, I don't have GPU, just a general software can be used anywhere. So, want to figure out the advantage and disadvantages of QPainter & OpenGL, then, decide to choose one of them to move on.
-
@student
Well openGL needs a GPU so its out if you dont have one. (well you do but it might no do openGL)So what do you need to do with these 2d shapes ?
-
@mrjj just a sw to draw shapes and can edit these shapes using Qt. looks even I don't have GPU, I can use QGLWidget and OpenGL on CPU, it seems also work.
Before moving on, want to do a survey about QPainter and OpenGL. -
@student
hi
There is always a GPU as else nothing can be shown on screen.
So if QGLWidget works it means your build in GPU does support openGL.QPainter has a much richer command set. with OpenGL, it would be from scratch.
But it can also be combined