summaryrefslogtreecommitdiffstats
path: root/examples/opengl/contextinfo/main.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-04-20 09:27:18 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2016-04-23 06:10:45 +0000
commit759b3f49c52c69f0a3ea2df014afbd3259e2bb83 (patch)
treec24ac96e5a5f2cf2f5886c50164a3ee631c39496 /examples/opengl/contextinfo/main.cpp
parent84a49594d0bde29668fb66187ac1ef2c842393a3 (diff)
OpenGL/contextinfo-Example: Add command line options and status label.
Add command line options to be able to set the QCoreApplication attributes that influence Open GL context creation and add a status label at the bottom that displays it besides the QT_OPENGL environment variable. Task-number: QTBUG-52693 Change-Id: Id9793292596e0feb3da5220fde2e5b2e495f87ff Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'examples/opengl/contextinfo/main.cpp')
-rw-r--r--examples/opengl/contextinfo/main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/opengl/contextinfo/main.cpp b/examples/opengl/contextinfo/main.cpp
index 0a75e10b290..8451551b7b9 100644
--- a/examples/opengl/contextinfo/main.cpp
+++ b/examples/opengl/contextinfo/main.cpp
@@ -43,6 +43,15 @@
int main(int argc, char **argv)
{
+ for (int i = 1; i < argc; ++i) {
+ if (!qstrcmp(argv[i], "-g"))
+ QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
+ else if (!qstrcmp(argv[i], "-s"))
+ QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);
+ else if (!qstrcmp(argv[i], "-d"))
+ QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
+ }
+
QApplication app(argc, argv);
Widget w;