summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-02-13 17:01:07 -0500
committerJonathan Bradley <jcb@pikum.xyz>2025-02-13 17:01:07 -0500
commit570498ee77505d44654fdbc97d094ae429323379 (patch)
treed76bdd53353c94ce12d1a3ee0002383c4266b0a8
parent19e7d7b70eac8f4903a1b7ce6c0092eff9a9d4fe (diff)
pke: track resize events
This should probably be replaced with a better solution, but for now it works (1 tick late).
-rw-r--r--src/game-settings.cpp1
-rw-r--r--src/game-settings.hpp7
-rw-r--r--src/window.cpp1
3 files changed, 9 insertions, 0 deletions
diff --git a/src/game-settings.cpp b/src/game-settings.cpp
index 6f09432..048bfcc 100644
--- a/src/game-settings.cpp
+++ b/src/game-settings.cpp
@@ -1,3 +1,4 @@
#include "game-settings.hpp"
GameSettings pkeSettings{};
+GameRuntime pkeRuntime{};
diff --git a/src/game-settings.hpp b/src/game-settings.hpp
index f5f6301..259d54a 100644
--- a/src/game-settings.hpp
+++ b/src/game-settings.hpp
@@ -51,6 +51,13 @@ struct GameSettings {
} rt;
};
+struct GameRuntime {
+ struct GameRuntimeGraphics {
+ uint64_t resize_index = 0;
+ } graphics;
+};
+
extern GameSettings pkeSettings;
+extern GameRuntime pkeRuntime;
#endif /* PKE_GAME_SETTINGS_HPP */
diff --git a/src/window.cpp b/src/window.cpp
index 33a9115..f356221 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -2907,6 +2907,7 @@ void DetermineMonitor() {
}
void RecreateSwapchain() {
+ pkeRuntime.graphics.resize_index += 1;
int width, height = 0;
glfwGetFramebufferSize(window, &width, &height);
while (width == 0 || height == 0) {