You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.9 KiB

#include <iostream>
#include <openvr.h>
#include <QResource>
#include <QApplication>
#include <QCoreApplication>
#include <QtCore>
#include <QtGui>
#include <QQmlApplicationEngine>
#include <QtQml>
#include <QQuickView>
#if defined(Q_OS_WIN)
#include <windows.h>
#include <QOpenGLContext>
#endif
#include "overlaywidget.h"
#include "openvroverlaycontroller.h"
using namespace vr;
void check_error(int line, EVRInitError error) { if (error != 0) printf("%d: error %s\n", line, VR_GetVRInitErrorAsSymbol(error)); }
int main(int argc, char *argv[])
{
// QApplication a(argc, argv);
// OverlayWidget *pOverlayWidget = new OverlayWidget;
//
// if(argc >= 2) {
// COpenVROverlayController::SharedInstance()->Init();
//
// COpenVROverlayController::SharedInstance()->SetWidget(pOverlayWidget);
// }
if(qgetenv("QMLSCENE_DEVICE") == "softwarecontext")
qDebug() << "Was software context";
// don't show widgets that you're going display in an overlay
//w.show();
qDebug() << "test";
qCritical() << "test";
// pOverlayWidget->show();
// QCoreApplication::setAttribute( Qt::AA_UseDesktopOpenGL );
// QCoreApplication::setAttribute( Qt::AA_Use96Dpi );
QGuiApplication a(argc, argv);
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("homePath", QDir::homePath());
engine.rootContext()->setContextProperty("applicationDirectory", QApplication::applicationDirPath());
engine.rootContext()->setContextProperty("idealThreadCount", QThread::idealThreadCount());
engine.load(QUrl(QStringLiteral("qrc:///main")));
if (engine.rootObjects().isEmpty())
{
qCritical() << "Error: no root objects";
return 1;
}
QObject *rootObject = engine.rootObjects().first();
if (!rootObject)
{
qCritical() << "Error: no root objects";
return 1;
}
return a.exec();
}