mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-05 19:31:04 +00:00
Only pause rendering if the Android activity is stopped (#14211)
This commit is contained in:
parent
89f3502b56
commit
fbec168e91
3 changed files with 3 additions and 15 deletions
|
@ -4207,7 +4207,7 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
|
|||
/*
|
||||
==================== Drawing begins ====================
|
||||
*/
|
||||
if (RenderingEngine::shouldRender())
|
||||
if (device->isWindowVisible())
|
||||
drawScene(graph, stats);
|
||||
/*
|
||||
==================== End scene ====================
|
||||
|
|
|
@ -141,17 +141,6 @@ 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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue