diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-19 13:49:38 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-19 13:49:38 +0300 |
commit | 3fe31aecf6d73c43cca48273022801ccef1d260d (patch) | |
tree | 2a2f069ab64dc8d50db21638c76cf3bfdc3daa74 /src | |
parent | 1e1d38081836e0c809942acc5aa75cf5c8aa4ea1 (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')
-rw-r--r-- | src/ui/window.c | 5 |
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")) { |