-
-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathengine.hpp
More file actions
73 lines (55 loc) · 1.25 KB
/
engine.hpp
File metadata and controls
73 lines (55 loc) · 1.25 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/**
* @file liblava/engine/engine.hpp
* @brief Engine
* @authors Lava Block OÜ and contributors
* @copyright Copyright (c) 2018-present, MIT License
*/
#pragma once
#include "liblava/app/app.hpp"
#include "liblava/engine/producer.hpp"
#include "liblava/engine/props.hpp"
namespace lava {
/// config
constexpr name _props_ = "props";
/**
* @brief Engine
*/
struct engine : app {
// Pointer to engine
using ptr = engine*;
/// App constructors
using app::app;
/**
* @brief Set up the engine
* @return Setup was successful or failed
*/
bool setup() override;
/// Props
lava::props props;
/// Producer
lava::producer producer;
/// Hud menu function
using hud_menu_func = std::function<void()>;
/// Function called on hud menu
hud_menu_func on_menu;
/// Hud active state
bool hud_active = false;
private:
/**
* @brief Handle configuration file
*/
void handle_config();
/**
* @brief Handle hud menu
*/
void hud_menu();
/// Hud menu id
id m_menu_layer;
#if LAVA_DEBUG
/// Demo id
id m_demo_layer;
#endif
/// Configuration file callback
json_file::callback m_config_callback;
};
} // namespace lava