summaryrefslogtreecommitdiffstats
path: root/examples/opengl/paintedwindow/main.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <[email protected]>2011-08-22 10:49:28 +0200
committerSamuel Rødal <[email protected]>2011-08-29 10:25:24 +0200
commit6e28e8441b698c3397c2c78125c877f2e9867cb1 (patch)
tree1e3ad0e43cb775854835817cd04bdc8b5e047e15 /examples/opengl/paintedwindow/main.cpp
parentaaa4a26f82f99fa8724841eba91bad029306e0ce (diff)
Copy core GL functionality to QtGui with QGL -> QOpenGL naming.
Change-Id: Ibc989afa4a30dd184d41d1a1cd89f97196e48855 Reviewed-on: http://codereview.qt.nokia.com/3710 Reviewed-by: Gunnar Sletta <[email protected]>
Diffstat (limited to 'examples/opengl/paintedwindow/main.cpp')
-rw-r--r--examples/opengl/paintedwindow/main.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/examples/opengl/paintedwindow/main.cpp b/examples/opengl/paintedwindow/main.cpp
new file mode 100644
index 00000000000..c77cf41f0f8
--- /dev/null
+++ b/examples/opengl/paintedwindow/main.cpp
@@ -0,0 +1,27 @@
+#include <QGuiApplication>
+#include <QRect>
+#include <QScreen>
+
+#include "paintedwindow.h"
+
+int main(int argc, char **argv)
+{
+ QGuiApplication app(argc, argv);
+
+ QScreen *screen = QGuiApplication::primaryScreen();
+
+ QRect screenGeometry = screen->availableGeometry();
+
+ QSurfaceFormat format;
+ format.setDepthBufferSize(16);
+ format.setSamples(4);
+
+ QPoint center = screenGeometry.center();
+ QRect windowRect(0, 0, 640, 480);
+
+ PaintedWindow window;
+ window.setGeometry(QRect(center - windowRect.center(), windowRect.size()));
+ window.show();
+
+ app.exec();
+}