diff options
Diffstat (limited to 'src/opengl/qopenglwindow.cpp')
-rw-r--r-- | src/opengl/qopenglwindow.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/opengl/qopenglwindow.cpp b/src/opengl/qopenglwindow.cpp index e29c79fdcb..b2a1a35a90 100644 --- a/src/opengl/qopenglwindow.cpp +++ b/src/opengl/qopenglwindow.cpp @@ -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. |