From 3aba743cd4d343178477d9ebc3f8e8f45d76c791 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Thu, 31 May 2018 22:46:03 +0200 Subject: [PATCH] Reload the textures when the renderer is asking for It seems that it fixes textures lose completly. --- src/blupi.cxx | 5 +++++ src/event.cxx | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/blupi.cxx b/src/blupi.cxx index 30ec8e9..8c294ad 100644 --- a/src/blupi.cxx +++ b/src/blupi.cxx @@ -385,6 +385,11 @@ HandleEvent (const SDL_Event & event) } break; + case SDL_RENDER_DEVICE_RESET: + case SDL_RENDER_TARGETS_RESET: + g_pPixmap->ReloadTargetTextures (); + break; + case SDL_USEREVENT: { switch (event.user.code) diff --git a/src/event.cxx b/src/event.cxx index 0ae3b94..28f7719 100644 --- a/src/event.cxx +++ b/src/event.cxx @@ -1702,7 +1702,6 @@ CEvent::SetFullScreen (bool bFullScreen) SDL_WINDOWPOS_CENTERED_DISPLAY (displayIndex)); m_pPixmap->LoadCursors (g_zoom); - m_pPixmap->ReloadTargetTextures (); /* Force this update before otherwise the coordinates retrieved with * the Warp SDL function are corresponding to the previous size. @@ -1761,7 +1760,6 @@ CEvent::SetWindowSize (Uint8 prevScale, Uint8 newScale) SDL_WINDOWPOS_CENTERED_DISPLAY (displayIndex)); m_pPixmap->LoadCursors (newScale); - m_pPixmap->ReloadTargetTextures (); /* Force this update before otherwise the coordinates retrieved with * the Warp SDL function are corresponding to the previous size.