-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.cpp
More file actions
49 lines (42 loc) · 1.01 KB
/
Main.cpp
File metadata and controls
49 lines (42 loc) · 1.01 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
44
45
46
47
48
49
// Maze game
using namespace std;
#include "Display.h"
#include "Input.h"
#include "Game.h"
#include "Map.h"
#include <iostream>
#include <fstream>
void cleanup(void)
{
Input::RemoveInstance();
Display::RemoveInstance();
Map::RemoveInstance();
Game::RemoveInstance();
}
int main (int argc, char** argv)
{
// Set up logging
std::ofstream out("log.txt");
std::cerr.rdbuf(out.rdbuf());
cerr << "Initializing...\n";
Display *display = Display::GetInstance();
cerr << "Display fully initialized\n\n";
Input *input = Input::GetInstance();
cerr << "Input fully initialized\n\n";
Game::GetInstance();
cerr << "Game fully initialized\n\n";
while (!input->IsClosed())
{
bool action = false;
display->DrawMainMenu();
while (!action)
{
action = display->UpdateMainMenuGUI();
input->ReadInput();
if (input->IsClosed())
action = true;
}
}
cleanup();
out.close();
}