diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-04-08 17:32:26 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-09 10:45:36 +0200 |
commit | 7537a4605ad65a039f5e9812939a13fbf7656e29 (patch) | |
tree | 0d58117757dd609438eb15315ac4c822f7e62281 | |
parent | 041c4d9c0bbb19dfa18ec304b5111259b0a48023 (diff) |
Correct QOpenGLContext::versionFunctions() docs
The example is incorrect: no context parameter is needed.
There was also no mentioning of the fact the the context must be
current at the time of calling initializeOpenGLFunctions(). This
is corrected too.
Change-Id: If8695140096e4b4f84927579c099b0af80750703
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r-- | src/gui/kernel/qopenglcontext.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index 7a901a2877..7382d63a06 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -617,7 +617,8 @@ QOpenGLFunctions *QOpenGLContext::functions() const Returns a pointer to an object that provides access to all functions for the version and profile of this context. Before using any of the functions - they must be initialized by calling QAbstractOpenGLFunctions::initializeOpenGLFunctions(). + they must be initialized by calling QAbstractOpenGLFunctions::initializeOpenGLFunctions() + with this context being the current context. Usually one would use the template version of this function to automatically have the result cast to the correct type. @@ -629,7 +630,7 @@ QOpenGLFunctions *QOpenGLContext::functions() const qWarning() << "Could not obtain required OpenGL context version"; exit(1); } - funcs->initializeOpenGLFunctions(context); + funcs->initializeOpenGLFunctions(); \endcode It is possible to request a functions object for a different version and profile @@ -659,8 +660,9 @@ QOpenGLFunctions *QOpenGLContext::functions() const /*! Returns a pointer to an object that provides access to all functions for the - \a versionProfile of the current context. Before using any of the functions they must - be initialized by calling QAbstractOpenGLFunctions::initializeOpenGLFunctions(). + \a versionProfile of this context. Before using any of the functions they must + be initialized by calling QAbstractOpenGLFunctions::initializeOpenGLFunctions() + with this context being the current context. Usually one would use the template version of this function to automatically have the result cast to the correct type. |