mirror of
https://github.com/Nexoniarz/Fry3DX.git
synced 2026-11-03 04:24:26 +00:00
Phones: sideways only; back from the background the Vulkan surface is made again (it was lost), the work saved on the way out and carried on with on the next start if the phone closed it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c1991d9f73
commit
a79a6c9020
9 changed files with 87 additions and 2 deletions
|
|
@ -371,6 +371,11 @@ int runClient(Game& game) {
|
|||
if (!input::captured()) ImGui_ImplSDL3_ProcessEvent(&ev);
|
||||
if (ev.type == SDL_EVENT_QUIT && game.allowQuit()) g_quit = true;
|
||||
if (ev.type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED) renderer.onResize();
|
||||
// (a phone: SDL waits once these are seen, until the app's back; the surface is new then)
|
||||
if (ev.type == SDL_EVENT_WILL_ENTER_BACKGROUND || ev.type == SDL_EVENT_LOW_MEMORY || ev.type == SDL_EVENT_TERMINATING) game.onBackground();
|
||||
#if defined(__ANDROID__)
|
||||
if (ev.type == SDL_EVENT_DID_ENTER_FOREGROUND) renderer.onSurfaceLost();
|
||||
#endif
|
||||
}
|
||||
const bool focused = SDL_GetWindowFlags(window.handle()) & SDL_WINDOW_INPUT_FOCUS;
|
||||
audio::setFocused(focused);
|
||||
|
|
|
|||
Loading…
Reference in a new issue