Files

21 lines
1.0 KiB
Diff
Raw Permalink Normal View History

diff --git a/src/renderer/Window.cpp b/src/renderer/Window.cpp
index ad608f8..3dff060 100644
--- a/src/renderer/Window.cpp
+++ b/src/renderer/Window.cpp
@@ -381,6 +381,15 @@ void Window::OnResized()
return;
SDL_GetWindowSize(m_nwnd, &m_width, &m_height);
SDL_GetWindowSizeInPixels(m_nwnd, &m_pixelWidth, &m_pixelHeight);
+ // vpinball-wasm: keep the (GL) default back buffer's tracked size in sync
+ // with the window's actual pixel size, mirroring what the BGFX backend
+ // already does explicitly every frame (RenderDevice.cpp's swapchain
+ // resize handling). Without this, glViewport(0, 0, m_width, m_height) in
+ // RenderTarget::Activate() keeps using the pre-resize size forever, so
+ // e.g. entering browser fullscreen (which resizes the canvas well after
+ // the back buffer was created) only renders into the old, smaller area.
+ if (m_backBuffer)
+ m_backBuffer->SetSize(m_pixelWidth, m_pixelHeight);
}
VPX::Window::VideoMode Window::SDLtoVPXVideoMode(const SDL_DisplayMode* mode)