diff options
author | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-02-27 08:44:47 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-03 19:43:11 +0100 |
commit | 15e58df3386b5438f6ae114a51ad4a258085e70b (patch) | |
tree | f88db61cd86efe94ba4ea2be01a64b4dfc99ba74 /src/quick | |
parent | b1f8c84eb5ddaea9dcbe58ed174106802080ff21 (diff) |
Added examples on how to use FBOs with scene graph.
I also cleaned up the naming of the other scene graph examples a bit,
so that they sort together in the samples list and have a more obvious
naming scheme.
Task-number: QTBUG-29548
Change-Id: I455eacb02c06058a6d49e12e4f1813ec80b655f6
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc | 26 | ||||
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsggeometry.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgsimplematerial.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgtexture.cpp | 2 |
5 files changed, 17 insertions, 17 deletions
diff --git a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc index 099c7eb443..40d77c3d9b 100644 --- a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc +++ b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc @@ -106,7 +106,7 @@ during the updatePaintNode() call. The rule of thumb is to only use classes with the "QSG" prefix inside the QQuickItem::updatePaintNode() function. -For more details, see the \l {Custom Geometry Example}. +For more details, see the \l {Scene Graph - Custom Geometry}. \section3 Preprocessing @@ -140,7 +140,7 @@ type. Below is a complete list of material classes: \annotatedlist{qtquick-scenegraph-materials} -For more details, see the \l {Simple Material Example} +For more details, see the \l {Scene Graph - Simple Material} \section2 Convenience Nodes @@ -280,21 +280,19 @@ needed to perform the rendering. The downside is that Qt Quick decides when to call the signals and this is the only time the OpenGL application is allowed to draw. -The \l {OpenGL Under QML} example gives an example on how to use use -these signals. - +The \l {Scene Graph - OpenGL Under QML} example gives an example on +how to use use these signals. The other alternative is to create a FramebufferObject, render into it and use the result as a textured node in the scene graph, for instance -using a QSGSimpleTextureNode. A simple way of doing the same is to use -a QQuickPaintedItem with QQuickPaintedItem::FramebufferObject as -render target and by calling QPainter::beginNativePainting() before -the OpenGL rendering and QPainter::endNativePainting() after. When -OpenGL content is integrated with a texture and FramebufferObject, the -application has more control over when the content is rendered. For -instance, the application can create a second QOpenGLContext on the -GUI thread which shares memory with the scene graph's OpenGL context -and drive the rendering manually. +using a QSGSimpleTextureNode. The \l {Scene Graph - Rendering FBOs} +and \l {Scene Graph - Rendering FBOs in a thread} examples show how +this can be done in an optimal manner. + +A simple way of doing the same is to use a QQuickPaintedItem with +QQuickPaintedItem::FramebufferObject as render target and by calling +QPainter::beginNativePainting() before the OpenGL rendering and +QPainter::endNativePainting() after. \warning When mixing OpenGL content with scene graph rendering, it is important the application does not leave the OpenGL context in a state diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index caf60dc30f..efc67c0437 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -909,7 +909,7 @@ void QQuickWindowPrivate::cleanup(QSGNode *n) scene graph and its OpenGL context being deleted. The sceneGraphInvalidated() signal will be emitted when this happens. - \sa {OpenGL Under QML} + \sa {Scene Graph - OpenGL Under QML} */ diff --git a/src/quick/scenegraph/coreapi/qsggeometry.cpp b/src/quick/scenegraph/coreapi/qsggeometry.cpp index 27d4ed413a..818b9b26aa 100644 --- a/src/quick/scenegraph/coreapi/qsggeometry.cpp +++ b/src/quick/scenegraph/coreapi/qsggeometry.cpp @@ -284,7 +284,7 @@ const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_ColoredPoint2D() setIndexDataPattern() functions. Whether this hint is respected or not is implementation specific. - \sa QSGGeometryNode, {Custom Geometry Example} + \sa QSGGeometryNode, {Scene Graph - Custom Geometry} */ diff --git a/src/quick/scenegraph/util/qsgsimplematerial.cpp b/src/quick/scenegraph/util/qsgsimplematerial.cpp index bed1b710ca..ee7a272fbe 100644 --- a/src/quick/scenegraph/util/qsgsimplematerial.cpp +++ b/src/quick/scenegraph/util/qsgsimplematerial.cpp @@ -142,7 +142,7 @@ the unique QSGSimpleMaterialShader implementation must be instantiated with a unique C++ type. - \sa {Simple Material Example} + \sa {Scene Graph - Simple Material} */ /*! diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp index 48927ce5e1..1a8c69a474 100644 --- a/src/quick/scenegraph/util/qsgtexture.cpp +++ b/src/quick/scenegraph/util/qsgtexture.cpp @@ -232,6 +232,8 @@ static void qt_debug_remove_texture(QSGTexture* texture) If the texture is used in such a way that atlas is not preferable, the function removedFromAtlas() can be used to extract a non-atlassed copy. + + \sa {Scene Graph - Rendering FBOs}, {Scene Graph - Rendering FBOs in a thread} */ /*! |