From d40af63aa3a3790335ea39e27572e807b8c9e5ff Mon Sep 17 00:00:00 2001 From: leo60228 Date: Tue, 7 Sep 2021 11:45:45 -0400 Subject: [PATCH] Split Func_input and Func_delta when unfocused Without this, `fixedloop` will loop infinitely until focus is regained. However, Emscripten won't actually know that focus is regained until `fixedloop` returns. --- desktop_version/src/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index 7915ae3f..39d5b466 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -239,6 +239,10 @@ static void unfocused_run(void); static const struct ImplFunc unfocused_func_list[] = { { Func_input, /* we still need polling when unfocused */ + NULL + }, + { + Func_delta, unfocused_run } }; @@ -785,7 +789,6 @@ static void unfocused_run(void) #undef FLIP } graphics.render(); - gameScreen.FlipScreen(graphics.flipmode); //We are minimised, so lets put a bit of a delay to save CPU #ifndef __EMSCRIPTEN__ SDL_Delay(100);