mirror of
https://github.com/SK-la/osu-framework.git
synced 2026-03-15 03:20:30 +00:00
Use (probably) better way to control frame draw in AndroidGameHost
This commit is contained in:
@@ -43,7 +43,7 @@ namespace osu.Framework.Android
|
||||
|
||||
protected override void DrawFrame()
|
||||
{
|
||||
if (AndroidGameActivity.Surface.MIsSurfaceReady)
|
||||
if (AndroidGameActivity.Surface.IsSurfaceReady)
|
||||
base.DrawFrame();
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,22 @@ namespace osu.Framework.Android
|
||||
}
|
||||
}
|
||||
|
||||
private volatile bool isSurfaceReady;
|
||||
|
||||
public bool IsSurfaceReady => isSurfaceReady;
|
||||
|
||||
public override void HandlePause()
|
||||
{
|
||||
base.HandlePause();
|
||||
isSurfaceReady = false;
|
||||
}
|
||||
|
||||
public override void HandleResume()
|
||||
{
|
||||
base.HandleResume();
|
||||
isSurfaceReady = true;
|
||||
}
|
||||
|
||||
public override WindowInsets? OnApplyWindowInsets(WindowInsets? insets)
|
||||
{
|
||||
updateSafeArea(insets);
|
||||
|
||||
Reference in New Issue
Block a user