From be85d152b436c152bbb554862064b9bd05b173b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= Date: Sat, 19 Sep 2020 13:49:38 +0300 Subject: [PATCH 1/1] Reload fonts when renderer is reset For some reason, SDL deletes the contents of render targets when the window is resized. IssueID #6 --- src/ui/window.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ui/window.c b/src/ui/window.c index 8ebb67a8..a7ec37dd 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -636,6 +636,11 @@ iBool processEvent_Window(iWindow *d, const SDL_Event *ev) { case SDL_WINDOWEVENT: { return handleWindowEvent_Window_(d, &ev->window); } + case SDL_RENDER_TARGETS_RESET: + case SDL_RENDER_DEVICE_RESET: { + resetFonts_Text(); + break; + } default: { SDL_Event event = *ev; if (event.type == SDL_USEREVENT && isCommand_UserEvent(ev, "window.unfreeze")) { -- 2.34.1