From 21101ef3550279fe83cf10bf5518548772edfc4c Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Tue, 24 May 2022 00:18:41 +0300 Subject: [PATCH] Fix window surface cache Closes #1 --- src/core.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core.cc b/src/core.cc index 2d64765..e9c8031 100644 --- a/src/core.cc +++ b/src/core.cc @@ -1278,6 +1278,11 @@ void _GNW95_process_message() case SDL_WINDOWEVENT_EXPOSED: windowRefreshAll(&_scr_size); break; + case SDL_WINDOWEVENT_SIZE_CHANGED: + // TODO: Recreate gSdlSurface in case size really changed (i.e. + // not alt-tabbing in fullscreen mode). + gSdlWindowSurface = SDL_GetWindowSurface(gSdlWindow); + break; case SDL_WINDOWEVENT_FOCUS_GAINED: gProgramIsActive = true; windowRefreshAll(&_scr_size);