}
/*!
- 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)
{
}
/*!
- 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().
}
/*!
- 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)
{
/*!
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().
/*!
- 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.
}
/*!
- 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.
void MyGLWindow::initializeGL()
{
m_context->makeCurrent(this);
- initializeGLFunctions();
+ initializeOpenGLFunctions();
}
\endcode
\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.
/*!
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)
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)
}
/*!
+ \fn void QOpenGLFunctions::initializeGLFunctions()
+ \obsolete
+
+ Use initializeOpenGLFunctions() instead.
+*/
+
+/*!
Initializes OpenGL function resolution for the current context.
After calling this function, the QOpenGLFunctions object can only be
This convenience function will do nothing on OpenGL/ES 1.x systems.
*/
+/*!
+ \fn bool QOpenGLFunctions::isInitialized(const QOpenGLFunctionsPrivate *d)
+ \internal
+*/
+
namespace {
enum ResolvePolicy
}
/*!
- 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.
{
}
+/*!
+ 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())
Q_GLOBAL_STATIC(QOpenGLEngineThreadStorage, qt_opengl_engine)
+/*!
+ \reimp
+*/
+
QPaintEngine *QOpenGLPaintDevice::paintEngine() const
{
if (d_ptr->engine)
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) {
}
}
+/*!
+ 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;