summaryrefslogtreecommitdiffstats
path: root/examples/opengl
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2020-02-19 11:13:48 +0100
committerJohan Klokkhammer Helsing <johan.helsing@qt.io>2020-02-20 16:11:02 +0100
commit012bb039e3c12d90546efcac84b1747b2a266c64 (patch)
tree925f28b0681a827cebb7031e4b5cd3cbabef7a9d /examples/opengl
parent734b3a33c19034fd0afbafb21ec291928f806a3f (diff)
Docs: Remove traces of QGL
The QGL* classes have been removed and the examples ported to QOpenGL, update the documentation to reflect that. Task-number: QTBUG-74408 Change-Id: Ibb4787cdeedc05a807d673943b61838f19092234 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'examples/opengl')
-rw-r--r--examples/opengl/doc/src/2dpainting.qdoc27
-rw-r--r--examples/opengl/doc/src/cube.qdoc10
2 files changed, 17 insertions, 20 deletions
diff --git a/examples/opengl/doc/src/2dpainting.qdoc b/examples/opengl/doc/src/2dpainting.qdoc
index e6b33e2a14..32b332fa8a 100644
--- a/examples/opengl/doc/src/2dpainting.qdoc
+++ b/examples/opengl/doc/src/2dpainting.qdoc
@@ -30,8 +30,8 @@
\title 2D Painting Example
\ingroup examples-widgets-opengl
- \brief The 2D Painting example shows how QPainter and QGLWidget can be used
- together to display accelerated 2D graphics on supported hardware.
+ \brief The 2D Painting example shows how QPainter and QOpenGLWidget can be
+ used together to display accelerated 2D graphics on supported hardware.
\image 2dpainting-example.png
@@ -39,23 +39,23 @@
paint devices provided by QPaintDevice subclasses, such as QWidget
and QImage.
- Since QGLWidget is a subclass of QWidget, it is possible
+ Since QOpenGLWidget is a subclass of QWidget, it is possible
to reimplement its \l{QWidget::paintEvent()}{paintEvent()} and use
QPainter to draw on the device, just as you would with a QWidget.
The only difference is that the painting operations will be accelerated
in hardware if it is supported by your system's OpenGL drivers.
In this example, we perform the same painting operations on a
- QWidget and a QGLWidget. The QWidget is shown with anti-aliasing
- enabled, and the QGLWidget will also use anti-aliasing if the
+ QWidget and a QOpenGLWidget. The QWidget is shown with anti-aliasing
+ enabled, and the QOpenGLWidget will also use anti-aliasing if the
required extensions are supported by your system's OpenGL driver.
\section1 Overview
- To be able to compare the results of painting onto a QGLWidget subclass
+ To be able to compare the results of painting onto a QOpenGLWidget subclass
with native drawing in a QWidget subclass, we want to show both kinds
of widget side by side. To do this, we derive subclasses of QWidget and
- QGLWidget, using a separate \c Helper class to perform the same painting
+ QOpenGLWidget, using a separate \c Helper class to perform the same painting
operations for each, and lay them out in a top-level widget, itself
provided a the \c Window class.
@@ -63,7 +63,7 @@
In this example, the painting operations are performed by a helper class.
We do this because we want the same painting operations to be performed
- for both our QWidget subclass and the QGLWidget subclass.
+ for both our QWidget subclass and the QOpenGLWidget subclass.
The \c Helper class is minimal:
@@ -81,7 +81,7 @@
The actual painting is performed in the \c paint() function. This takes
a QPainter that has already been set up to paint onto a paint device
- (either a QWidget or a QGLWidget), a QPaintEvent that provides information
+ (either a QWidget or a QOpenGLWidget), a QPaintEvent that provides information
about the region to be painted, and a measure of the elapsed time (in
milliseconds) since the paint device was last updated.
@@ -148,7 +148,7 @@
\section1 GLWidget Class Definition
The \c GLWidget class definition is basically the same as the \c Widget
- class except that it is derived from QGLWidget.
+ class except that it is derived from QOpenGLWidget.
\snippet 2dpainting/glwidget.h 0
@@ -161,11 +161,8 @@
\snippet 2dpainting/glwidget.cpp 0
- As well as initializing the \c elapsed member variable and storing the
- \c Helper object used to paint the widget, the base class's constructor
- is called with the format that specifies the \l QGL::SampleBuffers flag.
- This enables anti-aliasing if it is supported by your system's OpenGL
- driver.
+ The \c elapsed member variable is initialized and the \c Helper object used
+ to paint the widget is stored.
The \c animate() slot is exactly the same as that provided by the \c Widget
class:
diff --git a/examples/opengl/doc/src/cube.qdoc b/examples/opengl/doc/src/cube.qdoc
index 1fdfe0c6ec..4f5b6bda90 100644
--- a/examples/opengl/doc/src/cube.qdoc
+++ b/examples/opengl/doc/src/cube.qdoc
@@ -47,7 +47,7 @@
The example consist of two classes:
\list
- \li \c MainWidget extends QGLWidget and contains OpenGL ES 2.0
+ \li \c MainWidget extends QOpenGLWidget and contains OpenGL ES 2.0
initialization and drawing and mouse and timer event handling
\li \c GeometryEngine handles polygon geometries. Transfers polygon geometry
to vertex buffer objects and draws geometries from vertex buffer objects.
@@ -81,7 +81,7 @@
\snippet cube/fshader.glsl 0
- Using \c QGLShaderProgram we can compile, link and bind shader code to
+ Using QOpenGLShaderProgram we can compile, link and bind shader code to
graphics pipeline. This code uses Qt Resource files to access shader source code.
\snippet cube/mainwidget.cpp 3
@@ -92,9 +92,9 @@
\section1 Loading Textures from Qt Resource Files
- \c QGLWidget interface implements methods for loading textures from QImage to GL
- texture memory. We still need to use OpenGL provided functions for specifying
- the GL texture unit and configuring texture filtering options.
+ The \c QOpenGLWidget interface implements methods for loading textures from QImage
+ to OpenGL texture memory. We still need to use OpenGL provided functions for
+ specifying the OpenGL texture unit and configuring texture filtering options.
\snippet cube/mainwidget.cpp 4