summaryrefslogtreecommitdiffstats
path: root/main.cpp
blob: 4f830f59bda3d3e1d4a0f894263dba419d31032d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "ogreitem.h"
#include <QtGui/QApplication>
#include <QSGView>
#include <QDeclarativeContext>

int main(int argc, char **argv)
{
    QApplication app(argc, argv);

    qmlRegisterType<OgreItem>("Ogre", 1, 0, "OgreItem");

    QGLFormat f = QGLFormat::defaultFormat();
    f.setSampleBuffers(true);
    QSGView view(f);
    view.setResizeMode(QSGView::SizeRootObjectToView);
    view.setSource(QUrl::fromLocalFile("resources/example.qml"));
    view.rootContext()->setContextProperty("Window", &view);
    view.show();
    view.raise();

    return app.exec();
}