-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
43 lines (37 loc) · 1.03 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
#include <ctime>
#include <iostream>
#include "constants.hpp"
#include "map.hpp"
#include "character.hpp"
#include "map_generator.hpp"
#include "image_cache.h"
#include "gen_icons.h"
#include "game_manager.h"
#include "stdio_platform.h"
#include "glfwInitialization.h"
//#include "povray_platform.h"
#include <glfw_platform.h>
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
int main() {
srand(time(nullptr));
int seed = rand();
std::cout << "seed: " << seed << '\n';
std::mt19937_64 gen(seed);
gltactics::game_manager
manager(gen, [](gltactics::game_manager &a) {
return (gltactics::platform_module *) (new gltactics::glfw_platform(a));
});
//--------------------------------------------------------------------------------------
// Main game loop
while (true) { // Detect window close button or ESC key
manager.renderGameState();
manager.handleInput();
manager.stepState();
#ifdef __EMSCRIPTEN__
emscripten_sleep(1000/60);
#endif
}
return 0;
}