-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
47 lines (38 loc) · 1 KB
/
main.cpp
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/****************** Includes ********************/
#include <QApplication>
#include <QScreen>
#include "window.h"
/**************** Implementation ****************/
int main(int argc, char **argv)
{
QApplication app( argc, argv );
const QList<QScreen*> screenList = QGuiApplication::screens();
const QScreen *cv1Screen_p = nullptr;
// Create main window
window win;
// Check if one screen is Oculus Rift CV1 resolution
for( const QScreen *screen : screenList )
{
if( (screen->size().width() == 2160) && (screen->size().height() == 1200) )
{
cv1Screen_p = screen;
break;
}
}
// If Oculus Rift CV1 exists
if( cv1Screen_p != nullptr )
{
// Show fullscreen on Rift
win.move( cv1Screen_p->geometry().x(), cv1Screen_p->geometry().y() );
win.resize( cv1Screen_p->geometry().width(), cv1Screen_p->geometry().height() );
win.showFullScreen();
}
else
{
win.resize( 720 * 2, 576 );
win.show();
}
// Execute event loop
return app.exec();
}
// EOF