diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index aa1b92edbc..399b7ff121 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -210,7 +210,7 @@ QOpenGLContext* QOpenGLContext::currentContext() } /*! - Returns true if the two contexts are sharing OpenGL resources. + Returns true if the \a first and \a second contexts are sharing OpenGL resources. */ bool QOpenGLContext::areSharing(QOpenGLContext *first, QOpenGLContext *second) { @@ -243,7 +243,7 @@ QPlatformOpenGLContext *QOpenGLContext::shareHandle() const } /*! - Creates a new OpenGL context instance. + Creates a new OpenGL context instance with parent object \a parent. Before it can be used you need to set the proper format and call create(). @@ -267,8 +267,8 @@ void QOpenGLContext::setFormat(const QSurfaceFormat &format) } /*! - Sets the context to share textures, shaders, and other OpenGL resources - with. You need to call create() before it takes effect. + Makes this context share textures, shaders, and other OpenGL resources + with \a shareContext. You need to call create() before it takes effect. */ void QOpenGLContext::setShareContext(QOpenGLContext *shareContext) { @@ -460,7 +460,7 @@ GLuint QOpenGLContext::defaultFramebufferObject() const /*! Makes the context current in the current thread, against the given - \a surface. + \a surface. Returns true if successful. If \a surface is 0 this is equivalent to calling doneCurrent(). @@ -546,7 +546,7 @@ QSurface *QOpenGLContext::surface() const /*! - Swap the back and front buffers of the given surface. + Swap the back and front buffers of \a surface. Call this to finish a frame of OpenGL rendering, and make sure to call makeCurrent() again before you begin a new frame. 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;