-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
39 lines (28 loc) · 857 Bytes
/
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
#include <QDesktopWidget>
#include <QApplication>
#include "loz.h"
void center(QWidget &widget)
{
int x, y;
int screenWidth;
int screenHeight;
int WIDTH = 450;
int HEIGHT = 375;
QDesktopWidget *desktop = QApplication::desktop();
screenWidth = desktop->width();
screenHeight = desktop->height();
x = (screenWidth - WIDTH) / 2;
y = (screenHeight - HEIGHT) / 2;
widget.setGeometry(x, y, WIDTH, HEIGHT);
widget.setFixedSize(WIDTH, HEIGHT);
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
LoZ window;
//Not much worth saying goes on in here. Moreso because this isn't my code here, it's Prof. Tejada's/Whoever she borrowed this code from.
window.setWindowTitle("The Legend of Zelda: Oracle of Ages");
window.show();
center(window);
return app.exec();
}