From d805d33d7d3e6237fa6b2237f66ead753ffb6c33 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Tue, 30 Jun 2020 12:15:10 +1000 Subject: [PATCH] For SDL backend, reset graphics context if get a SDL_RENDER_DEVICE_RESET event --- src/Window.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Window.c b/src/Window.c index 8875dbb1f..e21778b7f 100644 --- a/src/Window.c +++ b/src/Window.c @@ -110,6 +110,7 @@ static void InitGraphicsMode(struct GraphicsMode* m) { *#########################################################################################################################*/ #if defined CC_BUILD_SDL #include +#include "Graphics.h" static SDL_Window* win_handle; static void RefreshWindowBounds(void) { @@ -350,6 +351,11 @@ void Window_ProcessEvents(void) { Event_RaiseVoid(&WindowEvents.Closing); SDL_DestroyWindow(win_handle); break; + + case SDL_RENDER_DEVICE_RESET: + Gfx_LoseContext("SDL device reset event"); + Gfx_RecreateContext(); + break; } } }