mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-26 22:11:11 +00:00
Fixed platform detection for Android
Conflicts: Source/OpenTK/Configuration.cs
This commit is contained in:
parent
a51540e8d9
commit
28fa768257
|
@ -38,7 +38,10 @@ namespace OpenTK
|
||||||
/// <summary>Provides information about the underlying OS and runtime.</summary>
|
/// <summary>Provides information about the underlying OS and runtime.</summary>
|
||||||
public static class Configuration
|
public static class Configuration
|
||||||
{
|
{
|
||||||
static bool runningOnWindows, runningOnUnix, runningOnX11, runningOnMacOS, runningOnLinux, runningOnMono;
|
static bool runningOnWindows, runningOnUnix, runningOnX11, runningOnMacOS, runningOnLinux;
|
||||||
|
static bool runningOnMono;
|
||||||
|
static bool runningOnAndroid;
|
||||||
|
static bool? sdl2supported;
|
||||||
volatile static bool initialized;
|
volatile static bool initialized;
|
||||||
readonly static object InitLock = new object();
|
readonly static object InitLock = new object();
|
||||||
|
|
||||||
|
@ -114,6 +117,26 @@ namespace OpenTK
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region public static bool RunningOnAndroid
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a <c>System.Boolean</c> indicating whether
|
||||||
|
/// OpenTK is running on an Android device.
|
||||||
|
/// </summary>
|
||||||
|
public static bool RunningOnAndroid
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
#if ANDROID
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region --- Private Methods ---
|
#region --- Private Methods ---
|
||||||
|
|
||||||
#region private static string DetectUnixKernel()
|
#region private static string DetectUnixKernel()
|
||||||
|
|
|
@ -76,6 +76,8 @@ namespace OpenTK.Platform.SDL2
|
||||||
current = OpenTK.Platform.X11.Glx.GetCurrentContext();
|
current = OpenTK.Platform.X11.Glx.GetCurrentContext();
|
||||||
else if (Configuration.RunningOnMacOS)
|
else if (Configuration.RunningOnMacOS)
|
||||||
current = OpenTK.Platform.MacOS.Cgl.GetCurrentContext();
|
current = OpenTK.Platform.MacOS.Cgl.GetCurrentContext();
|
||||||
|
else if (Configuration.RunningOnAndroid)
|
||||||
|
current = OpenTK.Platform.Egl.Egl.GetCurrentContext();
|
||||||
else
|
else
|
||||||
throw new NotSupportedException("Unknown platform, please report to http://www.opentk.com");
|
throw new NotSupportedException("Unknown platform, please report to http://www.opentk.com");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue