summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-12-17 01:17:11 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-12-17 01:17:11 (GMT)
commit7371d787d9b2667132c0caadb9964189b1d8c9fc (patch)
tree5721245811d1549f16d0103a4d2909a52cae0bcd /src/opengl
parent0414a73942272d8e863e464b3fbffeb9982964c1 (diff)
downloadQt-7371d787d9b2667132c0caadb9964189b1d8c9fc.zip
Qt-7371d787d9b2667132c0caadb9964189b1d8c9fc.tar.gz
Qt-7371d787d9b2667132c0caadb9964189b1d8c9fc.tar.bz2
Disable depth testing during the 2D QGLWidget::renderText()
Also document the depth testing conditions for the 2D and 3D versions of the function. Task-number: QTBUG-5041 Reviewed-by: Daniel Pope
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qgl.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 32534aa..466e851 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -4302,6 +4302,7 @@ static void qt_save_gl_state()
glDisable(GL_CULL_FACE);
glDisable(GL_LIGHTING);
glDisable(GL_STENCIL_TEST);
+ glDisable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
}
@@ -4355,6 +4356,10 @@ static void qt_gl_draw_text(QPainter *p, int x, int y, const QString &str,
\note This function clears the stencil buffer.
\note This function is not supported on OpenGL/ES systems.
+
+ \note This function temporarily disables depth-testing when the
+ text is drawn.
+
\l{Overpainting Example}{Overpaint} with QPainter::drawText() instead.
*/
@@ -4445,6 +4450,13 @@ void QGLWidget::renderText(int x, int y, const QString &str, const QFont &font,
have the labels move with the model as it is rotated etc.
\note This function is not supported on OpenGL/ES systems.
+
+ \note If depth testing is enabled before this function is called,
+ then the drawn text will be depth-tested against the models that
+ have already been drawn in the scene. Use \c{glDisable(GL_DEPTH_TEST)}
+ before calling this function to annotate the models without
+ depth-testing the text.
+
\l{Overpainting Example}{Overpaint} with QPainter::drawText() instead.
*/
void QGLWidget::renderText(double x, double y, double z, const QString &str, const QFont &font, int)