summaryrefslogtreecommitdiffstats
path: root/examples/opengl/cube/mainwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/opengl/cube/mainwidget.cpp')
-rw-r--r--examples/opengl/cube/mainwidget.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/examples/opengl/cube/mainwidget.cpp b/examples/opengl/cube/mainwidget.cpp
index 485bca54f4..e67c93da5a 100644
--- a/examples/opengl/cube/mainwidget.cpp
+++ b/examples/opengl/cube/mainwidget.cpp
@@ -72,14 +72,6 @@ void MainWidget::initializeGL()
initShaders();
initTextures();
-//! [2]
- // Enable depth buffer
- glEnable(GL_DEPTH_TEST);
-
- // Enable back face culling
- glEnable(GL_CULL_FACE);
-//! [2]
-
geometries = new GeometryEngine;
// Use QBasicTimer because its faster than QTimer
@@ -147,7 +139,16 @@ void MainWidget::paintGL()
// Clear color and depth buffer
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+//! [2]
+ // Enable depth buffer
+ glEnable(GL_DEPTH_TEST);
+
+ // Enable back face culling
+ glEnable(GL_CULL_FACE);
+//! [2]
+
texture->bind();
+ program.bind();
//! [6]
// Calculate model view transformation