summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-10-17 17:32:07 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-10-17 17:32:07 +0200
commitb545d55df9665a4be1677a9f0c7601f27e2d3371 (patch)
tree41c7a362e3d304145c9dcc4f5efd2b991918fb81
parent667bc202b55b8d00a4d84affb212adb2101a5c30 (diff)
parent667a052ed8e72d3b6f47f7388260045536698cae (diff)
Merge pull request #67539 from bruvzg/check_ctx
Check if Vulkan context for the window exists before resizing it to avoid unnecessary error messages.
-rw-r--r--platform/windows/display_server_windows.cpp3
-rw-r--r--platform/windows/display_server_windows.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp
index 3b773685c3..bc767a47e5 100644
--- a/platform/windows/display_server_windows.cpp
+++ b/platform/windows/display_server_windows.cpp
@@ -3087,7 +3087,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
rect_changed = true;
}
#if defined(VULKAN_ENABLED)
- if (context_vulkan && window_created) {
+ if (context_vulkan && window.context_created) {
// Note: Trigger resize event to update swapchains when window is minimized/restored, even if size is not changed.
context_vulkan->window_resize(window_id, window.width, window.height);
}
@@ -3547,6 +3547,7 @@ DisplayServer::WindowID DisplayServerWindows::_create_window(WindowMode p_mode,
windows.erase(id);
ERR_FAIL_V_MSG(INVALID_WINDOW_ID, "Failed to create Vulkan Window.");
}
+ wd.context_created = true;
}
#endif
diff --git a/platform/windows/display_server_windows.h b/platform/windows/display_server_windows.h
index 6403b57d8d..53cde001ae 100644
--- a/platform/windows/display_server_windows.h
+++ b/platform/windows/display_server_windows.h
@@ -369,6 +369,7 @@ class DisplayServerWindows : public DisplayServer {
bool no_focus = false;
bool window_has_focus = false;
bool exclusive = false;
+ bool context_created = false;
// Used to transfer data between events using timer.
WPARAM saved_wparam;