From 1f6bfc220774e9407fe88916843b76ed103cff72 Mon Sep 17 00:00:00 2001 From: Cristian Maureira-Fredes Date: Mon, 3 Sep 2018 14:02:13 +0200 Subject: Doc: Move literal code block to a separate file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We need to override this snippet for the documentation we generate for Qt for Python, and it is easier to have it on a separate file. Task-number: PYSIDE-801 Task-number: PYSIDE-691 Change-Id: Ideb5b6af25024279f167137d3b65660bb9c96a7e Reviewed-by: Topi Reiniƶ --- src/opengl/qglfunctions.cpp | 37 ++++--------------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) (limited to 'src/opengl/qglfunctions.cpp') diff --git a/src/opengl/qglfunctions.cpp b/src/opengl/qglfunctions.cpp index 07e1194342..7fe7102510 100644 --- a/src/opengl/qglfunctions.cpp +++ b/src/opengl/qglfunctions.cpp @@ -62,44 +62,18 @@ QT_BEGIN_NAMESPACE that need it. The recommended way to use QGLFunctions is by direct inheritance: - \code - class MyGLWidget : public QGLWidget, protected QGLFunctions - { - Q_OBJECT - public: - MyGLWidget(QWidget *parent = 0) : QGLWidget(parent) {} - - protected: - void initializeGL(); - void paintGL(); - }; - - void MyGLWidget::initializeGL() - { - initializeGLFunctions(); - } - \endcode + \snippet code/src_opengl_qglfunctions.cpp 0 The \c{paintGL()} function can then use any of the OpenGL ES 2.0 functions without explicit resolution, such as glActiveTexture() in the following example: - \code - void MyGLWidget::paintGL() - { - glActiveTexture(GL_TEXTURE1); - glBindTexture(GL_TEXTURE_2D, textureId); - ... - } - \endcode + \snippet code/src_opengl_qglfunctions.cpp 1 QGLFunctions can also be used directly for ad-hoc invocation of OpenGL ES 2.0 functions on all platforms: - \code - QGLFunctions glFuncs(QGLContext::currentContext()); - glFuncs.glActiveTexture(GL_TEXTURE1); - \endcode + \snippet code/src_opengl_qglfunctions.cpp 2 QGLFunctions provides wrappers for all OpenGL ES 2.0 functions, except those like \c{glDrawArrays()}, \c{glViewport()}, and @@ -114,10 +88,7 @@ QT_BEGIN_NAMESPACE feature. For example, the following checks if non power of two textures are available: - \code - QGLFunctions funcs(QGLContext::currentContext()); - bool npot = funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures); - \endcode + \snippet code/src_opengl_qglfunctions.cpp 3 \note This class has been deprecated in favor of QOpenGLFunctions. */ -- cgit v1.2.3 From a4b8e7141b3dd3bf3c2ac139b44ece0f74b054d8 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Fri, 15 Feb 2019 21:27:58 +0100 Subject: QtGui/Network/OpenGl/Widgets/Xml: use \nullptr in documentation Replace null and '\c nullptr' with \nullptr in the documentation. Change-Id: I58934eea06943309ba895833f1991629870ab45b Reviewed-by: Friedemann Kleint --- src/opengl/qglfunctions.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/opengl/qglfunctions.cpp') diff --git a/src/opengl/qglfunctions.cpp b/src/opengl/qglfunctions.cpp index 7fe7102510..f22f9f470b 100644 --- a/src/opengl/qglfunctions.cpp +++ b/src/opengl/qglfunctions.cpp @@ -170,7 +170,8 @@ QGLFunctions::QGLFunctions() /*! Constructs a function resolver for \a context. If \a context - is null, then the resolver will be created for the current QGLContext. + is \nullptr, then the resolver will be created for the current + QGLContext. An object constructed in this way can only be used with \a context and other contexts that share with it. Use initializeGLFunctions() @@ -305,7 +306,7 @@ bool QGLFunctions::hasOpenGLFeature(QGLFunctions::OpenGLFeature feature) const /*! Initializes GL function resolution for \a context. If \a context - is null, then the current QGLContext will be used. + is \nullptr, then the current QGLContext will be used. After calling this function, the QGLFunctions object can only be used with \a context and other contexts that share with it. -- cgit v1.2.3