summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/opengl/qgl.cpp44
-rw-r--r--src/opengl/qgl_p.h2
-rw-r--r--src/opengl/qglcolormap.cpp6
-rw-r--r--src/opengl/qglframebufferobject.cpp26
4 files changed, 51 insertions, 27 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index fcb3510..1bcfab8 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -228,7 +228,7 @@ bool qt_gl_preferGL2Engine()
\since 4.6
Sets the preferred OpenGL paint engine that is used to draw onto
- QGLWidgets, QGLPixelBuffers and QGLFrameBufferObjects with QPainter
+ QGLWidget, QGLPixelBuffer and QGLFramebufferObject targets with QPainter
in Qt.
The \a engineType parameter specifies which of the GL engines to
@@ -271,7 +271,7 @@ void QGL::setPreferredPaintEngine(QPaintEngine::Type engineType)
\i \link setStereo() Stereo buffers.\endlink
\i \link setDirectRendering() Direct rendering.\endlink
\i \link setOverlay() Presence of an overlay.\endlink
- \i \link setPlane() The plane of an overlay format.\endlink
+ \i \link setPlane() Plane of an overlay.\endlink
\i \link setSampleBuffers() Multisample buffers.\endlink
\endlist
@@ -1265,8 +1265,8 @@ QGLFormat::OpenGLVersionFlags QGLFormat::openGLVersionFlags()
/*!
- Returns the default QGLFormat for the application. All QGLWidgets
- that are created use this format unless another format is
+ Returns the default QGLFormat for the application. All QGLWidget
+ objects that are created use this format unless another format is
specified, e.g. when they are constructed.
If no special default format has been set using
@@ -1353,8 +1353,10 @@ void QGLFormat::setDefaultOverlayFormat(const QGLFormat &f)
/*!
- Returns true if all the options of the two QGLFormats are equal;
- otherwise returns false.
+ Returns true if all the options of the two QGLFormat objects
+ \a a and \a b are equal; otherwise returns false.
+
+ \relates QGLFormat
*/
bool operator==(const QGLFormat& a, const QGLFormat& b)
@@ -1371,8 +1373,10 @@ bool operator==(const QGLFormat& a, const QGLFormat& b)
/*!
- Returns false if all the options of the two QGLFormats are equal;
- otherwise returns true.
+ Returns false if all the options of the two QGLFormat objects
+ \a a and \a b are equal; otherwise returns true.
+
+ \relates QGLFormat
*/
bool operator!=(const QGLFormat& a, const QGLFormat& b)
@@ -3100,7 +3104,7 @@ const QGLContext* QGLContext::currentContext()
QGLFormat format\endlink and you can also create widgets with
customized rendering \link QGLContext contexts\endlink.
- You can also share OpenGL display lists between QGLWidgets (see
+ You can also share OpenGL display lists between QGLWidget objects (see
the documentation of the QGLWidget constructors for details).
Note that under Windows, the QGLContext belonging to a QGLWidget
@@ -3382,7 +3386,7 @@ bool QGLWidget::isValid() const
Returns true if this widget's GL context is shared with another GL
context, otherwise false is returned. Context sharing might not be
- possible if the QGLWidgets use different formats.
+ possible if the widgets use different formats.
\sa format()
*/
@@ -3480,7 +3484,7 @@ void QGLWidget::swapBuffers()
resizeGL() or paintGL().
This method will try to keep display list and texture object sharing
- in effect with other QGLWidgets, but changing the format might make
+ in effect with other QGLWidget objects, but changing the format might make
sharing impossible. Use isSharing() to see if sharing is still in
effect.
@@ -3784,7 +3788,7 @@ void QGLWidget::paintEvent(QPaintEvent *)
/*!
Renders the current scene on a pixmap and returns the pixmap.
- You can use this method on both visible and invisible QGLWidgets.
+ You can use this method on both visible and invisible QGLWidget objects.
This method will create a pixmap and a temporary QGLContext to
render on the pixmap. It will then call initializeGL(),
@@ -3970,6 +3974,8 @@ void QGLWidget::glDraw()
Calls glColor4 (in RGBA mode) or glIndex (in color-index mode)
with the color \a c. Applies to this widgets GL context.
+ \note This function is not supported on OpenGL/ES 2.0 systems.
+
\sa qglClearColor(), QGLContext::currentContext(), QColor
*/
@@ -3993,6 +3999,8 @@ void QGLWidget::qglColor(const QColor& c) const
glIndexi(ctx->colorIndex(c));
}
#endif //QT_OPENGL_ES
+#else
+ Q_UNUSED(c);
#endif //QT_OPENGL_ES_2
}
@@ -4109,9 +4117,12 @@ QImage QGLWidget::convertToGLFormat(const QImage& img)
the characters in the given \a font. \a listBase indicates the base
value used when generating the display lists for the font. The
default value is 2000.
+
+ \note This function is not supported on OpenGL/ES systems.
*/
int QGLWidget::fontDisplayListBase(const QFont & font, int listBase)
{
+#ifndef QT_OPENGL_ES
Q_D(QGLWidget);
int base;
@@ -4129,9 +4140,7 @@ int QGLWidget::fontDisplayListBase(const QFont & font, int listBase)
QString color_key;
if (font.styleStrategy() != QFont::NoAntialias) {
GLfloat color[4];
-#ifndef QT_OPENGL_ES
glGetFloatv(GL_CURRENT_COLOR, color);
-#endif
color_key.sprintf("%f_%f_%f",color[0], color[1], color[2]);
}
QString key = font.key() + color_key + QString::number((int) regenerate);
@@ -4154,6 +4163,11 @@ int QGLWidget::fontDisplayListBase(const QFont & font, int listBase)
base = maxBase;
}
return base;
+#else // QT_OPENGL_ES
+ Q_UNUSED(font);
+ Q_UNUSED(listBase);
+ return 0;
+#endif
}
#ifndef QT_OPENGL_ES
@@ -4856,7 +4870,7 @@ QGLContextResource::~QGLContextResource()
if (m_resources.size()) {
qWarning("QtOpenGL: Resources are still available at program shutdown.\n"
" This is possibly caused by a leaked QGLWidget, \n"
- " QGLFrameBufferObject or QGLPixelBuffer.");
+ " QGLFramebufferObject or QGLPixelBuffer.");
}
#endif
}
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index fdd28a4..57b40fb 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -196,7 +196,9 @@ public:
bool autoSwap;
QGLColormap cmap;
+#ifndef QT_OPENGL_ES
QMap<QString, int> displayListCache;
+#endif
bool disable_clear_on_painter_begin;
diff --git a/src/opengl/qglcolormap.cpp b/src/opengl/qglcolormap.cpp
index 7edb250..b86f9e0 100644
--- a/src/opengl/qglcolormap.cpp
+++ b/src/opengl/qglcolormap.cpp
@@ -42,14 +42,14 @@
/*!
\class QGLColormap
\brief The QGLColormap class is used for installing custom colormaps into
- QGLWidgets.
+ a QGLWidget.
\module OpenGL
\ingroup painting-3D
\ingroup shared
QGLColormap provides a platform independent way of specifying and
- installing indexed colormaps into QGLWidgets. QGLColormap is
+ installing indexed colormaps for a QGLWidget. QGLColormap is
especially useful when using the OpenGL color-index mode.
Under X11 you must use an X server that supports either a \c
@@ -61,7 +61,7 @@
least a \c PseudoColor visual. Note that you may experience
colormap flashing if your X server is running in 8 bit mode.
- Under Windows the size of the colormap is always set to 256
+ The size() of the colormap is always set to 256
colors. Note that under Windows you can also install colormaps
in child widgets.
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index 81f2aa9..4b8a67e 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -120,6 +120,7 @@ void QGLFramebufferObjectFormat::detach()
By default the format specifies a non-multisample framebuffer object with no
attachments, texture target \c GL_TEXTURE_2D, and internal format \c GL_RGBA8.
+ On OpenGL/ES systems, the default internal format is \c GL_RGBA.
\sa samples(), attachment(), target(), internalTextureFormat()
*/
@@ -165,8 +166,8 @@ QGLFramebufferObjectFormat::~QGLFramebufferObjectFormat()
/*!
Sets the number of samples per pixel for a multisample framebuffer object
- to \a samples.
- A sample count of 0 represents a regular non-multisample framebuffer object.
+ to \a samples. The default sample count of 0 represents a regular
+ non-multisample framebuffer object.
If the desired amount of samples per pixel is not supported by the hardware
then the maximum number of samples per pixel will be used. Note that
@@ -185,6 +186,7 @@ void QGLFramebufferObjectFormat::setSamples(int samples)
/*!
Returns the number of samples per pixel if a framebuffer object
is a multisample framebuffer object. Otherwise, returns 0.
+ The default value is 0.
\sa setSamples()
*/
@@ -205,8 +207,8 @@ void QGLFramebufferObjectFormat::setAttachment(QGLFramebufferObject::Attachment
}
/*!
- Returns the status of the depth and stencil buffers attached to
- a framebuffer object.
+ Returns the configuration of the depth and stencil buffers attached to
+ a framebuffer object. The default is QGLFramebufferObject::NoAttachment.
\sa setAttachment()
*/
@@ -229,7 +231,8 @@ void QGLFramebufferObjectFormat::setTextureTarget(GLenum target)
/*!
Returns the texture target of the texture attached to a framebuffer object.
- Ignored for multisample framebuffer objects.
+ Ignored for multisample framebuffer objects. The default is
+ \c GL_TEXTURE_2D.
\sa setTextureTarget(), samples()
*/
@@ -253,7 +256,9 @@ void QGLFramebufferObjectFormat::setInternalTextureFormat(GLenum internalTexture
/*!
Returns the internal format of a framebuffer object's texture or
- multisample framebuffer object's color buffer.
+ multisample framebuffer object's color buffer. The default is
+ \c GL_RGBA8 on desktop OpenGL systems, and \c GL_RGBA on
+ OpenGL/ES systems.
\sa setInternalTextureFormat()
*/
@@ -641,7 +646,8 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
By default, no depth and stencil buffers are attached. This behavior
can be toggled using one of the overloaded constructors.
- The default internal texture format is \c GL_RGBA8.
+ The default internal texture format is \c GL_RGBA8 for desktop
+ OpenGL, and \c GL_RGBA for OpenGL/ES.
It is important that you have a current GL context set when
creating the QGLFramebufferObject, otherwise the initialization
@@ -727,7 +733,8 @@ QGLFramebufferObject::QGLFramebufferObject(int width, int height, QMacCompatGLen
The \a attachment parameter describes the depth/stencil buffer
configuration, \a target the texture target and \a internal_format
the internal texture format. The default texture target is \c
- GL_TEXTURE_2D, while the default internal format is \c GL_RGBA8.
+ GL_TEXTURE_2D, while the default internal format is \c GL_RGBA8
+ for desktop OpenGL and \c GL_RGBA for OpenGL/ES.
\sa size(), texture(), attachment()
*/
@@ -758,7 +765,8 @@ QGLFramebufferObject::QGLFramebufferObject(int width, int height, Attachment att
The \a attachment parameter describes the depth/stencil buffer
configuration, \a target the texture target and \a internal_format
the internal texture format. The default texture target is \c
- GL_TEXTURE_2D, while the default internal format is \c GL_RGBA8.
+ GL_TEXTURE_2D, while the default internal format is \c GL_RGBA8
+ for desktop OpenGL and \c GL_RGBA for OpenGL/ES.
\sa size(), texture(), attachment()
*/