OpenGL paint engine
-
Hello. I
m new to Qt and grahpics sphere. So, I have a question: OpenGl support appeared in Qt 1.2. Therefore, it turns out that Qt 1.2 is an origin of OpenGL module in Qt,right? Recently I read the article about Qt and OpenGL and found "OpenGL paint engine" there. And I can
t understand what it is. Does OpenGL paint engine refer to QtOpenGl or not? -
Hi, welcome to devnet.
Qt 1.2 is ancient history. Not much of it has to do with current state of the library. the current version is Qt 5.2.1 (with 5.3 around the corner).
OpenGL paint engine was an experimental paint engine used for widgets in Qt4. It was meant to be replacement for the raster engine but it turned out it's not really feasible to use OpenGL to draw widgets. The Qt OpenGL module is also obsolete and you should not use it in new code.
Things got a little complicated for OpenGL in Qt5 branch because of the legacy modules, the split between widgets and QtQuick and new window facilities (like QWindow).
You can use OpenGL either via widgets (eg. QGLWidget), in QML, which also uses OpenGL as the rendering engine and in a "pure" OpenGL window (QWindow with OpenGL QSurfaceFormat).
There are also buncha support classes to get access to the OpenGL methods, which (unfortunately) went through some iterations, which means there is some duplicated (or sometimes triplicated?) functionality.
The current recommendation is to use the QOpenGL... classes, the QGL... ones being the old ones and probably will be deprecated in future versions. The exception is the QGLWidget which is a widget hosting OpenGL context. -
Thank you!