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/main.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/main.cpp')
-rw-r--r-- | examples/opengl/hellogl/main.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/examples/opengl/hellogl/main.cpp b/examples/opengl/hellogl/main.cpp index e645dba..f610b3b 100644 --- a/examples/opengl/hellogl/main.cpp +++ b/examples/opengl/hellogl/main.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include <QApplication> +#include <QDesktopWidget> #include "window.h" @@ -47,6 +48,13 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Window window; - window.show(); + window.resize(window.sizeHint()); + int desktopArea = QApplication::desktop()->width() * + QApplication::desktop()->height(); + int widgetArea = window.width() * window.height(); + if (((float)widgetArea / (float)desktopArea) < 0.75f) + window.show(); + else + window.showMaximized(); return app.exec(); } |