summaryrefslogtreecommitdiffstats
path: root/src/opengl/qopenglwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl/qopenglwindow.cpp')
-rw-r--r--src/opengl/qopenglwindow.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/opengl/qopenglwindow.cpp b/src/opengl/qopenglwindow.cpp
index de57cb99c1..a3677aa828 100644
--- a/src/opengl/qopenglwindow.cpp
+++ b/src/opengl/qopenglwindow.cpp
@@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE
immediately result in a call to paintGL(). Calling update() multiple times in
a row will not change the behavior in any way.
- This is a slot so it can be connected to a \l QTimer::timeout() signal to
+ This is a slot so it can be connected to a \l QChronoTimer::timeout() signal to
perform animation. Note however that in the modern OpenGL world it is a much
better choice to rely on synchronization to the vertical refresh rate of the
display. See \l{QSurfaceFormat::setSwapInterval()}{setSwapInterval()} on a
@@ -60,6 +60,23 @@ QT_BEGIN_NAMESPACE
given OpenGL version and profile, or enabling depth and stencil
buffers.
+ \note It is up to the application to ensure depth and stencil buffers are
+ requested from the underlying windowing system interface. Without requesting
+ a non-zero depth buffer size there is no guarantee that a depth buffer will
+ be available, and as a result depth testing related OpenGL operations may fail
+ to function as expected.
+
+ Commonly used depth and stencil buffer size requests are 24 and 8,
+ respectively. For example, a QOpenGLWindow subclass could do this in its
+ constructor:
+
+ \code
+ QSurfaceFormat format;
+ format.setDepthBufferSize(24);
+ format.setStencilBufferSize(8);
+ setFormat(format);
+ \endcode
+
Unlike QWindow, QOpenGLWindow allows opening a painter on itself and perform
QPainter-based drawing.
@@ -376,7 +393,7 @@ bool QOpenGLWindow::isValid() const
/*!
Prepares for rendering OpenGL content for this window by making the
corresponding context current and binding the framebuffer object, if there is
- one, in that context context.
+ one, in that context.
It is not necessary to call this function in most cases, because it is called
automatically before invoking paintGL(). It is provided nonetheless to support
@@ -554,7 +571,7 @@ void QOpenGLWindow::resizeGL(int w, int h)
\note When using a partial update behavior, like \c PartialUpdateBlend, the
output of the previous paintGL() call is preserved and, after the additional
- drawing perfomed in the current invocation of the function, the content is
+ drawing performed in the current invocation of the function, the content is
blitted or blended over the content drawn directly to the window in
paintUnderGL().