diff --git a/src/emulator.c b/src/emulator.c index 34cf370b..7d1f95f6 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -726,6 +726,7 @@ struct emu *emu_create(struct host *host) { /* setup host, bind event callbacks */ emu->host = host; emu->host->userdata = emu; + emu->host->video_resized = &emu_host_resized; emu->host->video_context_reset = &emu_host_context_reset; emu->host->video_context_destroyed = &emu_host_context_destroyed; emu->host->input_keydown = &emu_host_keydown; diff --git a/src/host/sdl_host.c b/src/host/sdl_host.c index c16abb96..f86d8151 100644 --- a/src/host/sdl_host.c +++ b/src/host/sdl_host.c @@ -706,12 +706,10 @@ static void host_poll_events(struct sdl_host *host) { } break; case SDL_WINDOWEVENT: - switch (ev.window.event) { - case SDL_WINDOWEVENT_RESIZED: { - host->video_width = ev.window.data1; - host->video_height = ev.window.data2; - video_resized(host); - } break; + if (ev.window.event == SDL_WINDOWEVENT_RESIZED) { + host->video_width = ev.window.data1; + host->video_height = ev.window.data2; + video_resized(host); } break;