summaryrefslogtreecommitdiffstats
path: root/examples/opengl/pbuffers/glwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/opengl/pbuffers/glwidget.cpp')
-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);
}