From 570498ee77505d44654fdbc97d094ae429323379 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Thu, 13 Feb 2025 17:01:07 -0500 Subject: pke: track resize events This should probably be replaced with a better solution, but for now it works (1 tick late). --- src/game-settings.cpp | 1 + src/game-settings.hpp | 7 +++++++ src/window.cpp | 1 + 3 files changed, 9 insertions(+) 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) { -- cgit v1.2.3