summaryrefslogtreecommitdiffstats
path: root/examples/gui/doc/src/openglwindow.qdoc
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2016-09-14 15:01:13 +0200
committerTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2016-09-22 16:45:15 +0000
commit0deb0796a42a64930f2d977cd4041c5f1c047187 (patch)
tree3b35aba7908a19987f38f0577da878ddfd199596 /examples/gui/doc/src/openglwindow.qdoc
parent524b59b0f51b554ecabbf2663891f9ae1650d122 (diff)
Modernize rasterwindow/openglwindow examples to use requestUpdate()
Change-Id: Ib8d0c42db7343247d0431ea008eb17da9ee98f4d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'examples/gui/doc/src/openglwindow.qdoc')
-rw-r--r--examples/gui/doc/src/openglwindow.qdoc12
1 files changed, 7 insertions, 5 deletions
diff --git a/examples/gui/doc/src/openglwindow.qdoc b/examples/gui/doc/src/openglwindow.qdoc
index e93451c9a5..f283c7cfc0 100644
--- a/examples/gui/doc/src/openglwindow.qdoc
+++ b/examples/gui/doc/src/openglwindow.qdoc
@@ -34,6 +34,9 @@
\image openglwindow-example.png Screenshot of the OpenGLWindow example
+ \note This is a low level example of how to use QWindow with OpenGL.
+ In practice you should consider using the higher level QOpenGLWindow class.
+
\section1 OpenGLWindow Super Class
Our OpenGLWindow class acts as an API which is then subclassed to do the
@@ -70,9 +73,8 @@
\snippet openglwindow/openglwindow.cpp 2
- The renderLater() function simply puts an update request event on
- the event loop, which leads to renderNow() being called once the event
- gets processed.
+ The renderLater() function simply calls QWindow::requestUpdate() to schedule
+ an update for when the system is ready to repaint.
We also call renderNow() when we get an expose event. The exposeEvent() is
the notification to the window that its exposure, meaning visibility, on
@@ -109,11 +111,11 @@
\l {http://www.khronos.org/registry/gles/}{Khronos OpenGL ES API Registry}.
If animation has been enabled with OpenGLWindow::setAnimating(true), we
- call renderLater() to put another update request on the event loop.
+ call renderLater() to schedule another update request.
\snippet openglwindow/openglwindow.cpp 4
- Enabling animation also triggers an update request as shown in the
+ Enabling animation also schedules an update request as shown in the
following code snippet.
\snippet openglwindow/openglwindow.cpp 5