-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
51 lines (33 loc) · 1.15 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
48
49
50
51
#include "Definitions.h"
#include <QApplication>
#include <QPushButton>
#include <iostream>
#include <QObject>
#include <thread>
// Componenti core
#include "MainWindow.h"
#include "GameLoop.h"
#include "Camera.h"
#include "Terrain.h"
#include "Kirby.h"
#include "Sounds.h"
#include "Door.h"
#include "Sprites.h"
// Hide console
#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")
int main(int argc, char* argv[]) {
// istanzio applicazione Qt
QApplication a(argc, argv);
TextureManager::getInstance();
//while (!TextureManager::getInstance().done) {}
GameLoop::getInstance().recalculateTicks(60);
GameLoop::getInstance().recalculateFps(75);
MainWindow* mw = new MainWindow();
QObject::connect(&GameLoop::getInstance(), &GameLoop::pleaseRender, mw, &MainWindow::pleaseRender);
QObject::connect(mw, &MainWindow::renderingCompleted, &GameLoop::getInstance(), &GameLoop::renderingCompleted);
GameLoop::getInstance().start();
GameLoop::getInstance().playBackgroundMusicLevelBased("levels/intro");
GameLoop::getInstance().showStart();
// eseguo applicazione Qt
return a.exec();
}