summaryrefslogtreecommitdiffstats
path: root/examples/opengl/paintedwindow/main.cpp
blob: c77cf41f0f896b5552d8db69b0fbdc84016d9796 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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();
}