From 3d04e4965e292be59464acc18c8306d89d3be3e1 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Thu, 30 Aug 2012 15:22:59 +0200 Subject: Doc: Fix some documentation issues. Change-Id: I21bba7b8a1808cf214cae1b7d3b6b5e41e36e3ba Reviewed-by: Frederik Gladhorn --- src/gui/opengl/qopenglframebufferobject.cpp | 2 +- src/gui/opengl/qopenglfunctions.cpp | 23 +++++++--- src/gui/opengl/qopenglpaintdevice.cpp | 70 ++++++++++++++++++++++++++++- 3 files changed, 87 insertions(+), 8 deletions(-) (limited to 'src/gui/opengl') diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp index 81c060fbf0..09d7a77174 100644 --- a/src/gui/opengl/qopenglframebufferobject.cpp +++ b/src/gui/opengl/qopenglframebufferobject.cpp @@ -1175,7 +1175,7 @@ QOpenGLFramebufferObject::Attachment QOpenGLFramebufferObject::attachment() cons } /*! - Sets the attachments of the framebuffer object. + Sets the attachments of the framebuffer object to \a attachment. This can be used to free or reattach the depth and stencil buffer attachments as needed. diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp index 2142c55fea..30e290ffd6 100644 --- a/src/gui/opengl/qopenglfunctions.cpp +++ b/src/gui/opengl/qopenglfunctions.cpp @@ -96,7 +96,7 @@ QT_BEGIN_NAMESPACE void MyGLWindow::initializeGL() { m_context->makeCurrent(this); - initializeGLFunctions(); + initializeOpenGLFunctions(); } \endcode @@ -157,6 +157,7 @@ QT_BEGIN_NAMESPACE \value Multisample glSampleCoverage() function is available. \value StencilSeparate Separate stencil functions are available. \value NPOTTextures Non power of two textures are available. + \value NPOTTextureRepeat Non power of two textures can use GL_REPEAT as wrap parameter. */ // Hidden private fields for additional extension data. @@ -198,10 +199,10 @@ static QOpenGLFunctionsPrivateEx *qt_gl_functions(QOpenGLContext *context = 0) /*! Constructs a default function resolver. The resolver cannot - be used until initializeGLFunctions() is called to specify + be used until initializeOpenGLFunctions() is called to specify the context. - \sa initializeGLFunctions() + \sa initializeOpenGLFunctions() */ QOpenGLFunctions::QOpenGLFunctions() : d_ptr(0) @@ -215,10 +216,10 @@ QOpenGLFunctions::QOpenGLFunctions() The context or another context in the group must be current. An object constructed in this way can only be used with \a context - and other contexts that share with it. Use initializeGLFunctions() + and other contexts that share with it. Use initializeOpenGLFunctions() to change the object's context association. - \sa initializeGLFunctions() + \sa initializeOpenGLFunctions() */ QOpenGLFunctions::QOpenGLFunctions(QOpenGLContext *context) : d_ptr(0) @@ -439,6 +440,13 @@ bool QOpenGLExtensions::hasOpenGLExtension(QOpenGLExtensions::OpenGLExtension ex return (d->m_extensions & int(extension)) != 0; } +/*! + \fn void QOpenGLFunctions::initializeGLFunctions() + \obsolete + + Use initializeOpenGLFunctions() instead. +*/ + /*! Initializes OpenGL function resolution for the current context. @@ -1456,6 +1464,11 @@ void QOpenGLFunctions::initializeOpenGLFunctions() This convenience function will do nothing on OpenGL/ES 1.x systems. */ +/*! + \fn bool QOpenGLFunctions::isInitialized(const QOpenGLFunctionsPrivate *d) + \internal +*/ + namespace { enum ResolvePolicy diff --git a/src/gui/opengl/qopenglpaintdevice.cpp b/src/gui/opengl/qopenglpaintdevice.cpp index e070ee6c58..09bd442892 100644 --- a/src/gui/opengl/qopenglpaintdevice.cpp +++ b/src/gui/opengl/qopenglpaintdevice.cpp @@ -111,7 +111,7 @@ QOpenGLPaintDevice::QOpenGLPaintDevice(const QSize &size) } /*! - Constructs a QOpenGLPaintDevice with the given \a size and \a ctx. + Constructs a QOpenGLPaintDevice with the given \a width and \a height. The QOpenGLPaintDevice is only valid for the current context. @@ -122,11 +122,21 @@ QOpenGLPaintDevice::QOpenGLPaintDevice(int width, int height) { } +/*! + Destroys the QOpenGLPaintDevice. +*/ + QOpenGLPaintDevice::~QOpenGLPaintDevice() { delete d_ptr->engine; } +/*! + \fn int QOpenGLPaintDevice::devType() const + \internal + \reimp +*/ + QOpenGLPaintDevicePrivate::QOpenGLPaintDevicePrivate(const QSize &sz) : size(sz) , ctx(QOpenGLContext::currentContext()) @@ -153,6 +163,10 @@ private: Q_GLOBAL_STATIC(QOpenGLEngineThreadStorage, qt_opengl_engine) +/*! + \reimp +*/ + QPaintEngine *QOpenGLPaintDevice::paintEngine() const { if (d_ptr->engine) @@ -167,21 +181,41 @@ QPaintEngine *QOpenGLPaintDevice::paintEngine() const return engine; } +/*! + Returns the OpenGL context associated with the paint device. +*/ + QOpenGLContext *QOpenGLPaintDevice::context() const { return d_ptr->ctx; } +/*! + Returns the pixel size of the paint device. + + \sa setSize() +*/ + QSize QOpenGLPaintDevice::size() const { return d_ptr->size; } +/*! + Sets the pixel size of the paint device to \a size. + + \sa size() +*/ + void QOpenGLPaintDevice::setSize(const QSize &size) { d_ptr->size = size; } +/*! + \reimp +*/ + int QOpenGLPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const { switch (metric) { @@ -211,34 +245,66 @@ int QOpenGLPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const } } +/*! + Returns the number of pixels per meter horizontally. + + \sa setDotsPerMeterX() +*/ + qreal QOpenGLPaintDevice::dotsPerMeterX() const { return d_ptr->dpmx; } +/*! + Returns the number of pixels per meter vertically. + + \sa setDotsPerMeterY() +*/ + qreal QOpenGLPaintDevice::dotsPerMeterY() const { return d_ptr->dpmy; } +/*! + Sets the number of pixels per meter horizontally to \a dpmx. + + \sa dotsPerMeterX() +*/ + void QOpenGLPaintDevice::setDotsPerMeterX(qreal dpmx) { d_ptr->dpmx = dpmx; } +/*! + Sets the number of pixels per meter vertically to \a dpmy. + + \sa dotsPerMeterY() +*/ + void QOpenGLPaintDevice::setDotsPerMeterY(qreal dpmy) { d_ptr->dpmx = dpmy; } /*! - Specifies whether painting should be flipped around the Y-axis or not. + Sets whether painting should be flipped around the Y-axis or not to \a flipped. + + \sa paintFlipped() */ void QOpenGLPaintDevice::setPaintFlipped(bool flipped) { d_ptr->flipped = flipped; } +/*! + Returns true if painting is flipped around the Y-axis. + + \sa setPaintFlipped() +*/ + bool QOpenGLPaintDevice::paintFlipped() const { return d_ptr->flipped; -- cgit v1.2.3