summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/examples/overpainting.qdoc7
-rw-r--r--examples/opengl/overpainting/glwidget.cpp5
2 files changed, 9 insertions, 3 deletions
diff --git a/doc/src/examples/overpainting.qdoc b/doc/src/examples/overpainting.qdoc
index 91100c0..b19b503 100644
--- a/doc/src/examples/overpainting.qdoc
+++ b/doc/src/examples/overpainting.qdoc
@@ -159,9 +159,10 @@
\snippet examples/opengl/overpainting/glwidget.cpp 7
- Once the list containing the object has been executed, the matrix stack
- needs to be restored to its original state at the start of this function
- before we can begin overpainting:
+ Once the list containing the object has been executed, the GL
+ states we changed and the matrix stack needs to be restored to its
+ original state at the start of this function before we can begin
+ overpainting:
\snippet examples/opengl/overpainting/glwidget.cpp 8
diff --git a/examples/opengl/overpainting/glwidget.cpp b/examples/opengl/overpainting/glwidget.cpp
index a6e6195..cad591f 100644
--- a/examples/opengl/overpainting/glwidget.cpp
+++ b/examples/opengl/overpainting/glwidget.cpp
@@ -166,6 +166,11 @@ void GLWidget::paintEvent(QPaintEvent *event)
//! [7]
//! [8]
+ glShadeModel(GL_FLAT);
+ glDisable(GL_CULL_FACE);
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_LIGHTING);
+
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
//! [8]