diff options
author | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-09-10 12:17:45 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-09-11 11:38:25 +0000 |
commit | 2deffa537c82e2f21e01dff5c8f5ba283dd06032 (patch) | |
tree | 50a43a5db178a5798b1729aadf601ec416377f9d /examples/wayland/qwindow-compositor/main.cpp | |
parent | 12a6bd37916802d06ac331fcbcd487ad6b4fafe6 (diff) |
New window compositor example
Start rewriting the QWindow-based compositor example to use
QOpenGLWindow and QOpenGLTextureBlitter. Also, make a better
separation between the compositor logic and the GUI.
Not yet feature complete.
Change-Id: I3e4fd839c79bc9dbf055c3a0f9939a68392deea9
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'examples/wayland/qwindow-compositor/main.cpp')
-rw-r--r-- | examples/wayland/qwindow-compositor/main.cpp | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/examples/wayland/qwindow-compositor/main.cpp b/examples/wayland/qwindow-compositor/main.cpp index a87d03f45..7f939a034 100644 --- a/examples/wayland/qwindow-compositor/main.cpp +++ b/examples/wayland/qwindow-compositor/main.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the examples of the Qt Wayland module ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: @@ -38,37 +38,20 @@ ** ****************************************************************************/ -#include "compositorwindow.h" -#include "qwindowcompositor.h" - #include <QGuiApplication> -#include <QStringList> -#include <QScreen> -#include <QSurfaceFormat> +#include "compositorwindow.h" +#include "windowcompositor.h" int main(int argc, char *argv[]) { - // Enable the following to have touch events generated from mouse events. - // Very handy for testing touch event delivery without a real touch device. - // QGuiApplication::setAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents, true); - QGuiApplication app(argc, argv); - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenGeometry = screen->availableGeometry(); - - QSurfaceFormat format; - format.setDepthBufferSize(16); - format.setStencilBufferSize(8); - - QRect geom = screenGeometry; - if (QCoreApplication::arguments().contains(QLatin1String("-nofullscreen"))) - geom = QRect(screenGeometry.width() / 4, screenGeometry.height() / 4, - screenGeometry.width() / 2, screenGeometry.height() / 2); - CompositorWindow window(format, geom); - QWindowCompositor compositor(&window); - compositor.create(); + CompositorWindow window; + window.resize(1500,800); + WindowCompositor comp(&window); + window.setCompositor(&comp); + comp.create(); window.show(); return app.exec(); |