summaryrefslogtreecommitdiff
path: root/examples/opengl/overpainting/glwidget.cpp
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-09-21 12:40:34 +1000
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-09-21 12:40:52 +1000
commit8db9f834e604c3a9eda8f76eacad2a9af20dbd33 (patch)
tree0d1e7ac8df6aae69cc878f605472ffb9db3a01ae /examples/opengl/overpainting/glwidget.cpp
parent544900b98b2ea996f5dccc65402bb9f32b89a3c2 (diff)
downloadqt4-tools-8db9f834e604c3a9eda8f76eacad2a9af20dbd33.tar.gz
Make OpenGL overpainting example compile under OpenGL/ES 1.1
Reviewed-by: trustme
Diffstat (limited to 'examples/opengl/overpainting/glwidget.cpp')
-rw-r--r--examples/opengl/overpainting/glwidget.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/examples/opengl/overpainting/glwidget.cpp b/examples/opengl/overpainting/glwidget.cpp
index 0dcccbfac4..f36fd4feea 100644
--- a/examples/opengl/overpainting/glwidget.cpp
+++ b/examples/opengl/overpainting/glwidget.cpp
@@ -168,10 +168,10 @@ void GLWidget::paintEvent(QPaintEvent *event)
//! [7]
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
- glTranslated(0.0, 0.0, -10.0);
- glRotated(xRot / 16.0, 1.0, 0.0, 0.0);
- glRotated(yRot / 16.0, 0.0, 1.0, 0.0);
- glRotated(zRot / 16.0, 0.0, 0.0, 1.0);
+ glTranslatef(0.0, 0.0, -10.0);
+ glRotatef(xRot / 16.0, 1.0, 0.0, 0.0);
+ glRotatef(yRot / 16.0, 0.0, 1.0, 0.0);
+ glRotatef(zRot / 16.0, 0.0, 0.0, 1.0);
logo->draw();
//! [7]
@@ -252,7 +252,11 @@ void GLWidget::setupViewport(int width, int height)
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
+#ifdef QT_OPENGL_ES
+ glOrthof(-0.5, +0.5, -0.5, 0.5, 4.0, 15.0);
+#else
glOrtho(-0.5, +0.5, -0.5, 0.5, 4.0, 15.0);
+#endif
glMatrixMode(GL_MODELVIEW);
}
//! [14]