From 82288308ecbe1481d82bee78ec59855b69d24391 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Thu, 6 Mar 2014 12:31:55 +0100 Subject: [PATCH] Doc fix QOpenGLContext::destroy() is private. The recommended way to free resources temporarily is simply to delete the context. Change-Id: I0d59b55afb209d56405f3584e4645bd4718790af Reviewed-by: Gunnar Sletta --- src/gui/kernel/qopenglcontext.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index 005f716788..f68915edeb 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -257,12 +257,10 @@ QMutex QOpenGLContextPrivate::makeCurrentTrackerMutex; rendering a new frame, after calling swapBuffers(). If the context is temporarily not needed, such as when the application is - not rendering, it can be useful to call destroy() to free resources. - However, if you do so you will need to call create() again before the - context can be used, and you might need to recreate any OpenGL resources - and reinitialize the OpenGL state. You can connect to the - aboutToBeDestroyed() signal to clean up any resources that have been - allocated with different ownership from the QOpenGLContext itself. + not rendering, it can be useful to delete it in order to free resources. + You can connect to the aboutToBeDestroyed() signal to clean up any + resources that have been allocated with different ownership from the + QOpenGLContext itself. Once a QOpenGLContext has been made current, you can render to it in a platform independent way by using Qt's OpenGL enablers such as