aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-05-05 11:45:31 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-05-06 11:56:02 +0000
commit45212181e0510eb94f67329731fd6574a6abe3f5 (patch)
tree321eb5f9cb7e374978fa08c674acc3de456da227 /src
parentb59e605b4d2f3c17b8bee0322ba156f990403d2d (diff)
Enhance QQuickFramebufferObject docs regarding the state
Add a note about resetOpenGLState() and the initial state to render(). This tries to tackle the common issue of forgetting to set or reset the state the custom OpenGL code relies on. Change-Id: I706b2b1eac76468a9b35cfb7cd99bd5483f2912c Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquickframebufferobject.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/quick/items/qquickframebufferobject.cpp b/src/quick/items/qquickframebufferobject.cpp
index 758727ed9e..c3e5b97baf 100644
--- a/src/quick/items/qquickframebufferobject.cpp
+++ b/src/quick/items/qquickframebufferobject.cpp
@@ -386,6 +386,17 @@ QOpenGLFramebufferObject *QQuickFramebufferObject::Renderer::framebufferObject()
* the FBO size.
*
* The FBO will be automatically unbound after the function returns.
+ *
+ * \note Do not assume that the OpenGL state is all set to the defaults when
+ * this function is invoked, or that it is maintained between calls. Both the Qt
+ * Quick renderer and the custom rendering code uses the same OpenGL
+ * context. This means that the state might have been modified by Quick before
+ * invoking this function.
+ *
+ * \note It is recommended to call QQuickWindow::resetOpenGLState() before
+ * returning. This resets OpenGL state used by the Qt Quick renderer and thus
+ * avoids interference from the state changes made by the rendering code in this
+ * function.
*/
/*!