summaryrefslogtreecommitdiff
path: root/src/game-settings.hpp
blob: 46f5d38f95470888d001d7eccaf20d8831bf9790 (plain)
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
#ifndef PKE_GAME_SETTINGS_HPP
#define PKE_GAME_SETTINGS_HPP

#include "level-types.hpp"
#include "pk.h"

#include <chrono>
#include <cstdint>

struct GameSettings {
	const char *executablePath;
	bool isGameRunning = true;
	bool isGamePaused = false;
	bool isShowingEditor = true;
	bool isRenderingDebug = false;
	bool isSimulationPaused = false;
	std::chrono::steady_clock steadyClock;
	int64_t targetFPS = 144;
	int64_t minFPS = 20;
	double deltaPerFrame = 1.0 / double(targetFPS);
	double minimumDeltaPerFrame = 1.0 / double(minFPS);
	struct editor {
		bool isUsingDebugCamera = false;
		bool isShowingConsole = true;
		bool isShowingEntityList = true;
		bool isShowingSceneEditor = true;
		bool isShowingUBO = true;
	} editorSettings;
	struct graphics {
		bool isFramerateUnlocked = false;
		bool isWaitingForVsync = true;
	} graphicsSettings;
	struct memory {
		struct pk_membucket *game = nullptr;
		struct pk_membucket *game_transient = nullptr;
	} mem_bkt;
	struct engineArgs {
		const char *levelName = nullptr;
		const char *pluginPath = nullptr;
		const char *projectPath = nullptr;
		const char *sceneName = nullptr;
	} args;
	struct runtime {
		// current level
		pke_level *activeLevel = nullptr;
		// level to start loading
		pke_level *nextLevel = nullptr;
		// level to unload
		pke_level *previousLevel = nullptr;
		bool was_framebuffer_resized = false;
	} rt;
	struct stats {
		double last_deltas[3] = {};
		double tick_rate = 0;
	} stats;
};

extern GameSettings pkeSettings;

#endif /* PKE_GAME_SETTINGS_HPP */