diff options
author | Sarah Smith <sarah.j.smith@nokia.com> | 2009-10-09 02:00:25 (GMT) |
---|---|---|
committer | Sarah Smith <sarah.j.smith@nokia.com> | 2009-10-09 02:00:25 (GMT) |
commit | 3d91051ce5ff92501b33580f1726f6726795c42d (patch) | |
tree | ceb60ad4e2f0b26fa6ef4412552118ad96705dc8 /examples/opengl/hellogl/glwidget.cpp | |
parent | ef8d9fa7091b0d45fe15aae43b8f1c47547cb16d (diff) | |
download | Qt-3d91051ce5ff92501b33580f1726f6726795c42d.zip Qt-3d91051ce5ff92501b33580f1726f6726795c42d.tar.gz Qt-3d91051ce5ff92501b33580f1726f6726795c42d.tar.bz2 |
hellogl now runs on QT_OPENGL_ES_1 (ie N95).
effort to have examples show portable GL code continues. One #ifdef
in whole example and it now runs on N95 and desktop.
Reviewed-by: Rhys Weatherley
Diffstat (limited to 'examples/opengl/hellogl/glwidget.cpp')
-rw-r--r-- | examples/opengl/hellogl/glwidget.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/examples/opengl/hellogl/glwidget.cpp b/examples/opengl/hellogl/glwidget.cpp index 282f21f..ffb3b15 100644 --- a/examples/opengl/hellogl/glwidget.cpp +++ b/examples/opengl/hellogl/glwidget.cpp @@ -150,10 +150,10 @@ void GLWidget::paintGL() { 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] @@ -166,7 +166,11 @@ void GLWidget::resizeGL(int width, int height) glMatrixMode(GL_PROJECTION); glLoadIdentity(); +#ifdef QT_OPENGL_ES_1 + 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); } //! [8] |