From 3a7971b93fad66247edf3b422edb9b4ee7e5e3cb Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 2 Feb 2023 03:41:15 +1100 Subject: osd/windows/window.cpp: Allow BGFX to bounce cleanly when toggling fullscreen on Windows with multiple output screens/windows. --- src/osd/windows/window.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp index a8a5b222c37..b4ef6d92eab 100644 --- a/src/osd/windows/window.cpp +++ b/src/osd/windows/window.cpp @@ -524,6 +524,10 @@ void winwindow_toggle_full_screen() // toggle the window mode video_config.windowed = !video_config.windowed; + // destroy the renderers first so that the render module can bounce if it depends on having a window handle + for (auto it = osd_common_t::window_list().rbegin(); osd_common_t::window_list().rend() != it; ++it) + (*it)->renderer_reset(); + // iterate over windows and toggle their fullscreen state for (const auto &window : osd_common_t::window_list()) { -- cgit v1.2.3