summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-09-19 13:49:38 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-09-21 11:22:40 +0300
commitbe85d152b436c152bbb554862064b9bd05b173b7 (patch)
tree9699ad0428b94c6894f3b108cda51f33e46aad98 /src/ui
parent47b95986c7feec37c0d4addc1981eb81af1981b2 (diff)
Reload fonts when renderer is reset
For some reason, SDL deletes the contents of render targets when the window is resized. IssueID #6
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/window.c5
1 files changed, 5 insertions, 0 deletions
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) {
636 case SDL_WINDOWEVENT: { 636 case SDL_WINDOWEVENT: {
637 return handleWindowEvent_Window_(d, &ev->window); 637 return handleWindowEvent_Window_(d, &ev->window);
638 } 638 }
639 case SDL_RENDER_TARGETS_RESET:
640 case SDL_RENDER_DEVICE_RESET: {
641 resetFonts_Text();
642 break;
643 }
639 default: { 644 default: {
640 SDL_Event event = *ev; 645 SDL_Event event = *ev;
641 if (event.type == SDL_USEREVENT && isCommand_UserEvent(ev, "window.unfreeze")) { 646 if (event.type == SDL_USEREVENT && isCommand_UserEvent(ev, "window.unfreeze")) {