-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
43 lines (38 loc) · 1.16 KB
/
main.cpp
File metadata and controls
43 lines (38 loc) · 1.16 KB
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
#include <QtGui>
#include <QWidget>
#include <QAbstractButton>
#include <QIcon>
#include <QDebug>
#include "main.h"
#include "customlabel.h"
#include "render.h"
#include "camera.h"
#include "menubutton.h"
#include "gamecontroller.h"
#ifndef RATE
#define RATE 60
#endif
GameController *gc;
void gameStart() {
gc->gameTimer->start(1000/GAMERATE);
gc->showAll();
}
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QWidget *menu = new QWidget();
//menu->showFullScreen();
//menu->resize(QApplication::desktop()->screenGeometry().width(),QApplication::desktop()->screenGeometry().height());
menu->resize(700,700);
menu->show();
CustomLabel *gameButton = new CustomLabel(&gameStart, menu);
gameButton->setPixmap(QPixmap(":/graphics/startgame.png"));
gameButton->move(menu->geometry().width()/2-gameButton->pixmap()->width()/2, menu->geometry().height()/2-gameButton->pixmap()->height()/2);
gameButton->show();
gc = new GameController(menu);
gc->hideAll();
app.exec();
delete gc;
delete gameButton;
delete menu;
return 0;//main.exec();
}