From 7537a4605ad65a039f5e9812939a13fbf7656e29 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 8 Apr 2014 17:32:26 +0200 Subject: 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 --- src/gui/kernel/qopenglcontext.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/gui/kernel') 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. -- cgit v1.2.3