summaryrefslogtreecommitdiffstats
path: root/examples/opengl
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-11-15 22:38:59 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-11-15 22:38:59 (GMT)
commitb2d5f886b36b4f4d317024db7cfd6668e2895cd4 (patch)
tree5d9fae4b723c537d8b986a9857e7ed6e582a2e72 /examples/opengl
parent0e74cc3e1a05147a8ae9c1c4be7c9f836da1acf3 (diff)
downloadQt-b2d5f886b36b4f4d317024db7cfd6668e2895cd4.zip
Qt-b2d5f886b36b4f4d317024db7cfd6668e2895cd4.tar.gz
Qt-b2d5f886b36b4f4d317024db7cfd6668e2895cd4.tar.bz2
Make pbuffers example compile under OpenGL/ES 1.1
Reviewed-by: Sarah Smith
Diffstat (limited to 'examples/opengl')
-rw-r--r--examples/opengl/pbuffers/glwidget.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/opengl/pbuffers/glwidget.cpp b/examples/opengl/pbuffers/glwidget.cpp
index 56ba65b..d843a73 100644
--- a/examples/opengl/pbuffers/glwidget.cpp
+++ b/examples/opengl/pbuffers/glwidget.cpp
@@ -175,7 +175,11 @@ void GLWidget::perspectiveProjection()
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
+#ifdef QT_OPENGL_ES
+ glFrustumf(-aspect, +aspect, -1.0, +1.0, 4.0, 15.0);
+#else
glFrustum(-aspect, +aspect, -1.0, +1.0, 4.0, 15.0);
+#endif
glMatrixMode(GL_MODELVIEW);
}
@@ -183,7 +187,11 @@ void GLWidget::orthographicProjection()
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
+#ifdef QT_OPENGL_ES
+ glOrthof(-1.0, +1.0, -1.0, +1.0, -90.0, +90.0);
+#else
glOrtho(-1.0, +1.0, -1.0, +1.0, -90.0, +90.0);
+#endif
glMatrixMode(GL_MODELVIEW);
}