mirror of
https://github.com/SK-la/osu-framework.git
synced 2026-03-15 03:20:30 +00:00
32 lines
1009 B
C#
32 lines
1009 B
C#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
using System;
|
|
using osu.Framework.Bindables;
|
|
using osu.Framework.Platform;
|
|
using osu.Framework.Platform.SDL3;
|
|
|
|
namespace osu.Framework.Android
|
|
{
|
|
internal class AndroidGameWindow : SDL3MobileWindow
|
|
{
|
|
public override IntPtr SurfaceHandle => AndroidGameActivity.Surface.NativeSurface?.Handle ?? IntPtr.Zero;
|
|
|
|
public AndroidGameWindow(GraphicsSurfaceType surfaceType, string appName)
|
|
: base(surfaceType, appName)
|
|
{
|
|
}
|
|
|
|
public override void Create()
|
|
{
|
|
base.Create();
|
|
|
|
SafeAreaPadding.BindTo(AndroidGameActivity.Surface.SafeAreaPadding);
|
|
|
|
// Android SDL doesn't receive these events at start, so it never receives focus until it comes back from background
|
|
((BindableBool)CursorInWindow).Value = true;
|
|
Focused = true;
|
|
}
|
|
}
|
|
}
|