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>
This commit is contained in:
Laszlo Agocs 2015-05-05 11:45:31 +02:00
parent b59e605b4d
commit 45212181e0
1 changed files with 11 additions and 0 deletions

View File

@ -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.
*/
/*!