1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Android: Pause rendering while the app is paused (#14058)

This commit is contained in:
grorp 2023-12-19 20:18:28 +01:00 committed by GitHub
parent b1aec1b5c8
commit 00d9d96e48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 72 additions and 55 deletions

View file

@ -138,6 +138,17 @@ public:
const irr::core::dimension2d<u32> initial_screen_size,
const bool initial_window_maximized);
static bool shouldRender()
{
// On Android, pause rendering while the app is in background (generally not visible).
// Don't do this on desktop because windows can be partially visible.
#ifdef __ANDROID__
return get_raw_device()->isWindowActive();
#else
return true;
#endif
};
private:
v2u32 _getWindowSize() const;