Modified resize logic

This commit is contained in:
Alexandre 2026-07-20 01:14:21 +02:00
parent 622c0478ac
commit 79a73b8ceb

View File

@ -427,6 +427,11 @@ void Engine::run() {
while (!glfwWindowShouldClose(window)) { while (!glfwWindowShouldClose(window)) {
glfwPollEvents(); glfwPollEvents();
int w, h;
glfwGetFramebufferSize(window, &w, &h);
if (w != _windowExtent.width || h != _windowExtent.height ) { _requestResize = true; };
if (_requestResize) {resizeSwapchain();}; if (_requestResize) {resizeSwapchain();};
if (glfwGetWindowAttrib(window, GLFW_ICONIFIED)) { if (glfwGetWindowAttrib(window, GLFW_ICONIFIED)) {
@ -1318,7 +1323,7 @@ void Engine::resizeSwapchain() {
destroySwapchain(); destroySwapchain();
int w, h; int w, h;
glfwGetWindowSize(window, &w, &h); glfwGetFramebufferSize(window, &w, &h);
_windowExtent.width = w; _windowExtent.width = w;
_windowExtent.height = h; _windowExtent.height = h;