summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/game.cpp5
-rw-r--r--src/game.hpp20
3 files changed, 27 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e840fb..6854915 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,6 +14,8 @@ set(CMAKE_CXX_FLAGS_RELEASE "-O3 -s DNDEBUG")
set(PKE_SOURCE_FILES
src/main.cpp
src/macros.hpp
+ src/game.hpp
+ src/game.cpp
src/memory.hpp
src/memory.cpp
src/dynamic-array.hpp
diff --git a/src/game.cpp b/src/game.cpp
new file mode 100644
index 0000000..3cf2109
--- /dev/null
+++ b/src/game.cpp
@@ -0,0 +1,5 @@
+
+#include "game.hpp"
+
+GameSettings pkeSettings{};
+
diff --git a/src/game.hpp b/src/game.hpp
new file mode 100644
index 0000000..80c971f
--- /dev/null
+++ b/src/game.hpp
@@ -0,0 +1,20 @@
+#ifndef PKE_GAME_HPP
+#define PKE_GAME_HPP
+
+#include <chrono>
+#include <cstdint>
+
+using GameTimeDuration = std::chrono::duration<int64_t, std::nano>;
+using GameTimePoint = std::chrono::steady_clock::time_point;
+
+struct GameSettings {
+ bool isGameRunning = true;
+ bool isGamePaused = false;
+ bool isFramerateUnlocked = true;
+ int64_t targetFPS = 144;
+ GameTimeDuration nanosecondsPerFrame = GameTimeDuration(std::chrono::nanoseconds::period::den / targetFPS);
+};
+
+extern GameSettings pkeSettings;
+
+#endif /* PKE_GAME_HPP */