From 83afae56258c8069a8ca157d37b6b564b7f98905 Mon Sep 17 00:00:00 2001 From: roytam1 Date: Mon, 29 Jul 2024 23:09:31 +0800 Subject: [PATCH] sdl: handle SDL_WINDOWEVENT_EXPOSED event to fix redrawing issue --- devices/video/display_sdl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/devices/video/display_sdl.cpp b/devices/video/display_sdl.cpp index b2b7ead..65dccbf 100644 --- a/devices/video/display_sdl.cpp +++ b/devices/video/display_sdl.cpp @@ -97,6 +97,9 @@ void Display::handle_events(const WindowEvent& wnd_event) { if (wnd_event.sub_type == SDL_WINDOWEVENT_SIZE_CHANGED && wnd_event.window_id == impl->disp_wnd_id) impl->resizing = false; + if (wnd_event.sub_type == SDL_WINDOWEVENT_EXPOSED && + wnd_event.window_id == impl->disp_wnd_id) + SDL_RenderPresent(impl->renderer); } void Display::blank() {