qt5base-lts/examples/opengl/paintedwindow/main.cpp
Samuel Rødal 1b18315001 Improved and made public the QOpenGLPaintDevice API.
The new API is more flexible, allowing the use of QOpenGLPaintDevice
with any QOpenGLContext, and putting more responsibility on the user for
ensuring the correct FBO is current (the user knows best anyhow).

Task-number: QTBUG-21263

Change-Id: I50b954125f552baef52fbb3fe2ed907a11ad519c
Reviewed-on: http://codereview.qt-project.org/4325
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
2011-09-08 11:07:56 +02:00

24 lines
506 B
C++

#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();
QPoint center = screenGeometry.center();
QRect windowRect(0, 0, 640, 480);
PaintedWindow window;
window.setGeometry(QRect(center - windowRect.center(), windowRect.size()));
window.show();
app.exec();
}