From 974e02b03e3359e9cf5e09aaf0cb3d6b635f1235 Mon Sep 17 00:00:00 2001 From: Neico Date: Sat, 29 Apr 2017 21:33:33 +0200 Subject: [PATCH] fix AngleWindowInfo compile errors on mobile introduced by #458 --- src/OpenTK/Platform/Android/AndroidGameView.cs | 1 + src/OpenTK/Platform/Egl/EglContext.cs | 2 ++ src/OpenTK/Platform/Factory.cs | 8 ++++++-- src/OpenTK/Platform/Utilities.cs | 9 +++++---- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/OpenTK/Platform/Android/AndroidGameView.cs b/src/OpenTK/Platform/Android/AndroidGameView.cs index 5cd78e0..c167c7e 100644 --- a/src/OpenTK/Platform/Android/AndroidGameView.cs +++ b/src/OpenTK/Platform/Android/AndroidGameView.cs @@ -27,6 +27,7 @@ using Android.Views; using Android.Runtime; using Android.Graphics; using OpenTK.Platform.Egl; +using SurfaceType = Android.Views.SurfaceType; namespace OpenTK.Platform.Android { diff --git a/src/OpenTK/Platform/Egl/EglContext.cs b/src/OpenTK/Platform/Egl/EglContext.cs index 35388b7..5133573 100644 --- a/src/OpenTK/Platform/Egl/EglContext.cs +++ b/src/OpenTK/Platform/Egl/EglContext.cs @@ -155,8 +155,10 @@ namespace OpenTK.Platform.Egl { if (window is EglWindowInfo) WindowInfo = (EglWindowInfo) window; + #if !ANDROID else if (window is IAngleWindowInfoInternal) WindowInfo = ((IAngleWindowInfoInternal) window).EglWindowInfo; + #endif if (!Egl.MakeCurrent(WindowInfo.Display, WindowInfo.Surface, WindowInfo.Surface, HandleAsEGLContext)) { diff --git a/src/OpenTK/Platform/Factory.cs b/src/OpenTK/Platform/Factory.cs index 0117e6c..c56d22b 100644 --- a/src/OpenTK/Platform/Factory.cs +++ b/src/OpenTK/Platform/Factory.cs @@ -27,7 +27,6 @@ using System; using System.Diagnostics; -using OpenTK.Platform.Egl; namespace OpenTK.Platform { @@ -103,7 +102,12 @@ namespace OpenTK.Platform else if (Configuration.RunningOnAndroid) Embedded = new Android.AndroidFactory(); #endif else Embedded = new UnsupportedPlatform(); - Angle = new EglAnglePlatformFactory(Embedded); + + #if ANDROID + Angle = new UnsupportedPlatform(); + #else + Angle = new Egl.EglAnglePlatformFactory(Embedded); + #endif } #endif else diff --git a/src/OpenTK/Platform/Utilities.cs b/src/OpenTK/Platform/Utilities.cs index a0c262a..6720066 100644 --- a/src/OpenTK/Platform/Utilities.cs +++ b/src/OpenTK/Platform/Utilities.cs @@ -13,7 +13,6 @@ using System.Runtime.InteropServices; using System.Reflection; using System.Diagnostics; using OpenTK.Graphics; -using OpenTK.Platform.Egl; #endregion @@ -396,6 +395,7 @@ namespace OpenTK.Platform #region + #if !__MOBILE__ /// /// Creates an IWindowInfo instance for Angle rendering, based on /// supplied platform window (e.g. a window created with @@ -403,11 +403,12 @@ namespace OpenTK.Platform /// /// /// - public static IAngleWindowInfo CreateAngleWindowInfo(IWindowInfo platformWindow) + public static Egl.IAngleWindowInfo CreateAngleWindowInfo(IWindowInfo platformWindow) { - return new AngleWindowInfo(platformWindow); + return new Egl.AngleWindowInfo(platformWindow); } - + #endif + #endregion #endregion -- 2.7.4