1b18315001
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>
24 lines
506 B
C++
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();
|
|
}
|