1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Reload the textures when the renderer is asking for

It seems that it fixes textures lose completly.
This commit is contained in:
Mathieu Schroeter 2018-05-31 22:46:03 +02:00
parent 2d80222257
commit 3aba743cd4
2 changed files with 5 additions and 2 deletions

View File

@ -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)

View File

@ -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.