Updated all the OpenTK references to use NuGet (#4836)
authorMatthew Leibowitz <mattleibow@live.com>
Tue, 12 Feb 2019 12:59:18 +0000 (14:59 +0200)
committerRui Marinho <me@ruimarinho.net>
Tue, 12 Feb 2019 12:59:18 +0000 (12:59 +0000)
* Updated all the OpenTK references to use NuGet
 - Using the same NuGet version of OpenTK across the board
 - Added a gallery factory to allow for platform-specific pages
 - Added the OpenGL galleries to Android, iOS, GTK# and WPF

* Fix the build for iOS and macOS

* Fix the modified defines for the control gallery

44 files changed:
.nuspec/Xamarin.Forms.Platform.GTK.nuspec
.nuspec/Xamarin.Forms.Platform.WPF.nuspec
Xamarin.Forms.ControlGallery.Android/Activity1.cs
Xamarin.Forms.ControlGallery.Android/PlatformSpecificCoreGalleryFactory.cs [new file with mode: 0644]
Xamarin.Forms.ControlGallery.Android/StringProvider.cs [deleted file]
Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj
Xamarin.Forms.ControlGallery.GTK/App.config
Xamarin.Forms.ControlGallery.GTK/PlatformSpecificCoreGalleryFactory.cs [new file with mode: 0644]
Xamarin.Forms.ControlGallery.GTK/Program.cs
Xamarin.Forms.ControlGallery.GTK/StringProvider.cs [deleted file]
Xamarin.Forms.ControlGallery.GTK/Xamarin.Forms.ControlGallery.GTK.csproj
Xamarin.Forms.ControlGallery.MacOS/NativeServices.cs
Xamarin.Forms.ControlGallery.MacOS/PlatformSpecificCoreGalleryFactory.cs [new file with mode: 0644]
Xamarin.Forms.ControlGallery.MacOS/Xamarin.Forms.ControlGallery.MacOS.csproj
Xamarin.Forms.ControlGallery.Tizen/PlatformSpecificCoreGalleryFactory.cs [new file with mode: 0644]
Xamarin.Forms.ControlGallery.Tizen/StringProvider.cs [deleted file]
Xamarin.Forms.ControlGallery.WPF/App.config
Xamarin.Forms.ControlGallery.WPF/MainWindow.xaml.cs
Xamarin.Forms.ControlGallery.WPF/OpenGLViewApp.cs [deleted file]
Xamarin.Forms.ControlGallery.WPF/OpenTK.dll.config [deleted file]
Xamarin.Forms.ControlGallery.WPF/PlatformSpecificCoreGalleryFactory.cs [new file with mode: 0644]
Xamarin.Forms.ControlGallery.WPF/StringProvider.cs [deleted file]
Xamarin.Forms.ControlGallery.WPF/Xamarin.Forms.ControlGallery.WPF.csproj
Xamarin.Forms.ControlGallery.WindowsUniversal/PlatformSpecificCoreGalleryFactory.cs [new file with mode: 0644]
Xamarin.Forms.ControlGallery.WindowsUniversal/StringProvider.cs [deleted file]
Xamarin.Forms.ControlGallery.WindowsUniversal/Xamarin.Forms.ControlGallery.WindowsUniversal.csproj
Xamarin.Forms.ControlGallery.iOS/AppDelegate.cs
Xamarin.Forms.ControlGallery.iOS/PlatformSpecificCoreGalleryFactory.cs [new file with mode: 0644]
Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj
Xamarin.Forms.Controls/CoreGallery.cs
Xamarin.Forms.Controls/GalleryPages/OpenGLGalleries/AdvancedOpenGLGallery.cs [moved from Xamarin.Forms.ControlGallery.GTK/AdvancedOpenGLView.cs with 95% similarity]
Xamarin.Forms.Controls/GalleryPages/OpenGLGalleries/BasicOpenGLGallery.cs [moved from Xamarin.Forms.ControlGallery.GTK/BasicOpenGLView.cs with 87% similarity]
Xamarin.Forms.Controls/GalleryPages/OpenGLGallery.cs [deleted file]
Xamarin.Forms.Controls/RootPages/RootTabbedNavigationContentPage.cs
Xamarin.Forms.Maps.GTK/app.config
Xamarin.Forms.Maps.WPF/Xamarin.Forms.Maps.WPF.csproj
Xamarin.Forms.Maps.WPF/app.config [deleted file]
Xamarin.Forms.Platform.GTK/Libs/OpenTK/OpenTK.dll [deleted file]
Xamarin.Forms.Platform.GTK/Libs/OpenTK/OpenTK.dll.config [deleted file]
Xamarin.Forms.Platform.GTK/Libs/OpenTK/README.txt [deleted file]
Xamarin.Forms.Platform.GTK/Xamarin.Forms.Platform.GTK.csproj
Xamarin.Forms.Platform.WPF/OpenTK.dll.config [deleted file]
Xamarin.Forms.Platform.WPF/Xamarin.Forms.Platform.WPF.csproj
Xamarin.Forms.Platform.WPF/app.config

index d2d6841..f372eb5 100644 (file)
     <dependencies>
       <group>
         <dependency id="Xamarin.Forms" version="$version$" />
+        <dependency id="OpenTK" version="3.0.1" />
       </group>
     </dependencies>
   </metadata>
   <files>
-    <file src="..\Xamarin.Forms.Platform.GTK\Libs\OpenTK\OpenTK.dll" target="lib\net45"/>
-    <file src="..\Xamarin.Forms.Platform.GTK\Libs\OpenTK\OpenTK.dll.config" target="content"/>
     <file src="..\Xamarin.Forms.Platform.GTK\Libs\webkit-sharp\webkit-sharp.dll" target="lib\net45"/>
     <file src="..\Xamarin.Forms.Platform.GTK\Libs\webkit-sharp\webkit-sharp.dll.config" target="content"/>
     <file src="..\Xamarin.Forms.Platform.GTK\bin\$Configuration$\Xamarin.Forms.Platform.GTK.dll" target="lib\net45"/>
index 067a51b..9c15f00 100644 (file)
@@ -15,8 +15,8 @@
     <dependencies>
       <group targetFramework="net45">
         <dependency id="Xamarin.Forms" version="$version$"/>
-        <dependency id="OpenTK" version="2.0.0"/>
-        <dependency id="OpenTK.GLControl" version="1.1.2349.61993"/>
+        <dependency id="OpenTK" version="3.0.1"/>
+        <dependency id="OpenTK.GLControl" version="3.0.1"/>
       </group>
     </dependencies>
   </metadata>
index bb78d31..24c3744 100644 (file)
@@ -19,7 +19,6 @@ using AColor = Android.Graphics.Color;
 
 [assembly: Dependency (typeof (CacheService))]
 [assembly: Dependency (typeof (TestCloudService))]
-[assembly: Dependency (typeof (StringProvider))]
 [assembly: ExportRenderer (typeof (DisposePage), typeof (DisposePageRenderer))]
 [assembly: ExportRenderer (typeof (DisposeLabel), typeof (DisposeLabelRenderer))]
 [assembly: ExportRenderer (typeof (CustomButton), typeof (CustomButtonRenderer))]
diff --git a/Xamarin.Forms.ControlGallery.Android/PlatformSpecificCoreGalleryFactory.cs b/Xamarin.Forms.ControlGallery.Android/PlatformSpecificCoreGalleryFactory.cs
new file mode 100644 (file)
index 0000000..bb739bd
--- /dev/null
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using Xamarin.Forms;
+using Xamarin.Forms.ControlGallery.Android;
+using Xamarin.Forms.Controls;
+
+[assembly: Dependency(typeof(PlatformSpecificCoreGalleryFactory))]
+
+namespace Xamarin.Forms.ControlGallery.Android
+{
+       public class PlatformSpecificCoreGalleryFactory : IPlatformSpecificCoreGalleryFactory
+       {
+               public string Title => "Android Core Gallery";
+
+               public IEnumerable<(Func<Page> Create, string Title)> GetPages()
+               {
+#if HAVE_OPENTK
+                       yield return (() => new AdvancedOpenGLGallery(), "Advanced OpenGL Gallery - Legacy");
+#else
+                       return null;
+#endif
+               }
+       }
+}
diff --git a/Xamarin.Forms.ControlGallery.Android/StringProvider.cs b/Xamarin.Forms.ControlGallery.Android/StringProvider.cs
deleted file mode 100644 (file)
index 018ea7b..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-using Xamarin.Forms.Controls;
-
-namespace Xamarin.Forms.ControlGallery.Android
-{
-       public class StringProvider : IStringProvider
-       {
-               public string CoreGalleryTitle
-               {
-                       get
-                       {
-                               return "Android CoreGallery";
-                       }
-               }
-       }
-}
\ No newline at end of file
index ff88f8e..cefa461 100644 (file)
@@ -33,6 +33,7 @@
     <AndroidEnableMultiDex>true</AndroidEnableMultiDex>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
+    <DefineConstants>HAVE_OPENTK</DefineConstants>
     <AndroidKeyStore>True</AndroidKeyStore>
     <AndroidSigningKeyStore>$(SolutionDir)debug.keystore</AndroidSigningKeyStore>
     <AndroidSigningStorePass>android</AndroidSigningStorePass>
@@ -44,7 +45,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;HAVE_OPENTK</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <AndroidLinkMode>Full</AndroidLinkMode>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     <NoWarn>
     </NoWarn>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
+    <DefineConstants>TRACE;HAVE_OPENTK</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <AndroidLinkMode>SdkOnly</AndroidLinkMode>
@@ -73,6 +75,7 @@
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     <NoWarn>
     </NoWarn>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="Microsoft.CSharp" />
@@ -85,6 +88,7 @@
     <Reference Include="System.Net.Http" />
     <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Xml" />
+    <Reference Include="OpenTK-1.0" />
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Activity1.cs" />
     <Compile Include="FormsAppCompatActivity.cs" />
     <Compile Include="MainApplication.cs" />
     <Compile Include="PerformanceTrackerRenderer.cs" />
+    <Compile Include="PlatformSpecificCoreGalleryFactory.cs" />
     <Compile Include="PreApplicationClassActivity.cs" />
     <Compile Include="Properties\MapsKey.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="CustomRenderers.cs" />
     <Compile Include="ColorPicker.cs" />
     <Compile Include="SampleNativeControl.cs" />
-    <Compile Include="StringProvider.cs" />
     <Compile Include="TestCloudService.cs" />
     <Compile Include="_1909CustomRenderer.cs" />
     <Compile Include="_2489CustomRenderer.cs" />
     <Compile Include="_58406EffectRenderer.cs" />
     <Compile Include="_59457CustomRenderer.cs" />
     <Compile Include="_60122ImageRenderer.cs" />
+    <Compile Include="..\Xamarin.Forms.Controls\GalleryPages\OpenGLGalleries\AdvancedOpenGLGallery.cs">
+      <Link>GalleryPages\AdvancedOpenGLGallery.cs</Link>
+    </Compile>
   </ItemGroup>
   <ItemGroup>
     <AndroidAsset Include="Assets\default.css" />
index 2ed2990..50233c4 100644 (file)
@@ -11,7 +11,7 @@
       </dependentAssembly>
       <dependentAssembly>
         <assemblyIdentity name="OpenTK" publicKeyToken="bad199fe84eb3df4" culture="neutral"/>
-        <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
+        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
       </dependentAssembly>
     </assemblyBinding>
   </runtime>
diff --git a/Xamarin.Forms.ControlGallery.GTK/PlatformSpecificCoreGalleryFactory.cs b/Xamarin.Forms.ControlGallery.GTK/PlatformSpecificCoreGalleryFactory.cs
new file mode 100644 (file)
index 0000000..818aae5
--- /dev/null
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using Xamarin.Forms;
+using Xamarin.Forms.ControlGallery.GTK;
+using Xamarin.Forms.Controls;
+
+[assembly: Dependency(typeof(PlatformSpecificCoreGalleryFactory))]
+
+namespace Xamarin.Forms.ControlGallery.GTK
+{
+       public class PlatformSpecificCoreGalleryFactory : IPlatformSpecificCoreGalleryFactory
+       {
+               public string Title => "GTK# Core Gallery";
+
+               public IEnumerable<(Func<Page> Create, string Title)> GetPages()
+               {
+#if HAVE_OPENTK
+                       yield return (() => new BasicOpenGLGallery(), "Basic OpenGL Gallery - Legacy");
+                       yield return (() => new AdvancedOpenGLGallery(), "Advanced OpenGL Gallery - Legacy");
+#else
+                       return null;
+#endif
+               }
+       }
+}
index 44d6a54..4632c95 100644 (file)
@@ -21,11 +21,9 @@ namespace Xamarin.Forms.ControlGallery.GTK
             GtkOpenGL.Init();
             GtkThemes.Init();
             Gtk.Application.Init();
-                       FormsMaps.Init(string.Empty);
-                       Forms.Init();
+            FormsMaps.Init(string.Empty);
+            Forms.Init();
             var app = new App();
-            //var app = new BasicOpenGLApp();
-            //var app = new AdvancedOpenGLApp();
             var window = new FormsWindow();
             window.LoadApplication(app);
             window.SetApplicationTitle("Xamarin.Forms GTK# Backend");
diff --git a/Xamarin.Forms.ControlGallery.GTK/StringProvider.cs b/Xamarin.Forms.ControlGallery.GTK/StringProvider.cs
deleted file mode 100644 (file)
index 3df99ee..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-using Xamarin.Forms;
-using Xamarin.Forms.ControlGallery.GTK;
-
-[assembly: Dependency(typeof(StringProvider))]
-namespace Xamarin.Forms.ControlGallery.GTK
-{
-    public class StringProvider : Controls.IStringProvider
-    {
-        public string CoreGalleryTitle
-        {
-            get
-            {
-                return "GTK# CoreGallery";
-            }
-        }
-    }
-}
\ No newline at end of file
index 76a1afd..e9e82b7 100644 (file)
@@ -20,7 +20,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DefineConstants>DEBUG;TRACE;HAVE_OPENTK;__GTK__</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -30,7 +30,7 @@
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
+    <DefineConstants>TRACE;HAVE_OPENTK;__GTK__</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
       <HintPath>..\Xamarin.Forms.Platform.GTK\Libs\gtk-sharp\gtk-sharp-2.0\gtk-sharp.dll</HintPath>
       <Private>False</Private>
     </Reference>
-    <Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\Xamarin.Forms.Platform.GTK\Libs\OpenTK\OpenTK.dll</HintPath>
-    </Reference>
     <Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\Xamarin.Forms.Platform.GTK\Libs\gtk-sharp\gtk-sharp-2.0\pango-sharp.dll</HintPath>
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="AdvancedOpenGLView.cs" />
-    <Compile Include="BasicOpenGLView.cs" />
+    <PackageReference Include="OpenTK" Version="3.0.1" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\xamarin.forms.controls\gallerypages\openglgalleries\AdvancedOpenGLGallery.cs">
+      <Link>GalleryPages\AdvancedOpenGLGallery.cs</Link>
+    </Compile>
+    <Compile Include="..\xamarin.forms.controls\gallerypages\openglgalleries\BasicOpenGLGallery.cs">
+      <Link>GalleryPages\BasicOpenGLGallery.cs</Link>
+    </Compile>
+    <Compile Include="PlatformSpecificCoreGalleryFactory.cs" />
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="RegistrarValidationService.cs" />
     <Compile Include="SampleNativeControl.cs" />
-    <Compile Include="StringProvider.cs" />
   </ItemGroup>
   <ItemGroup>
     <None Include="App.config" />
index 1b813a4..df0b19c 100644 (file)
@@ -6,7 +6,6 @@ using Xamarin.Forms.Controls;
 using Xamarin.Forms.Platform.MacOS;
 
 [assembly: Dependency(typeof(TestCloudService))]
-[assembly: Dependency(typeof(StringProvider))]
 [assembly: Dependency(typeof(CacheService))]
 [assembly: ExportRenderer(typeof(DisposePage), typeof(DisposePageRenderer))]
 [assembly: ExportRenderer(typeof(DisposeLabel), typeof(DisposeLabelRenderer))]
@@ -52,14 +51,6 @@ namespace Xamarin.Forms.ControlGallery.MacOS
                }
        }
 
-       public class StringProvider : IStringProvider
-       {
-               public string CoreGalleryTitle
-               {
-                       get { return "iOS Core Gallery"; }
-               }
-       }
-
        public class TestCloudService : ITestCloudService
        {
                public bool IsOnTestCloud()
diff --git a/Xamarin.Forms.ControlGallery.MacOS/PlatformSpecificCoreGalleryFactory.cs b/Xamarin.Forms.ControlGallery.MacOS/PlatformSpecificCoreGalleryFactory.cs
new file mode 100644 (file)
index 0000000..a1b39e9
--- /dev/null
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using Xamarin.Forms;
+using Xamarin.Forms.ControlGallery.MacOS;
+using Xamarin.Forms.Controls;
+
+[assembly: Dependency(typeof(PlatformSpecificCoreGalleryFactory))]
+
+namespace Xamarin.Forms.ControlGallery.MacOS
+{
+       public class PlatformSpecificCoreGalleryFactory : IPlatformSpecificCoreGalleryFactory
+       {
+               public string Title => "macOS Core Gallery";
+
+               public IEnumerable<(Func<Page> Create, string Title)> GetPages()
+               {
+#if HAVE_OPENTK
+                       yield return (() => new BasicOpenGLGallery(), "Basic OpenGL Gallery - Legacy");
+                       yield return (() => new AdvancedOpenGLGallery(), "Advanced OpenGL Gallery - Legacy");
+#else
+                       return null;
+#endif
+               }
+       }
+}
index e944930..4560462 100644 (file)
@@ -17,7 +17,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug</OutputPath>
-    <DefineConstants>DEBUG;</DefineConstants>
+    <DefineConstants>DEBUG;HAVE_OPENTK</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <ConsolePause>false</ConsolePause>
     </LinkMode>
     <XamMacArch>
     </XamMacArch>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <Optimize>true</Optimize>
     <OutputPath>bin\Release</OutputPath>
-    <DefineConstants>
-    </DefineConstants>
+    <DefineConstants>HAVE_OPENTK</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <ConsolePause>false</ConsolePause>
@@ -60,6 +60,7 @@
     </TlsProvider>
     <XamMacArch>
     </XamMacArch>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="Microsoft.CSharp" />
@@ -69,6 +70,7 @@
     <Reference Include="System.Net.Http" />
     <Reference Include="Xamarin.Mac" />
     <Reference Include="netstandard" />
+    <Reference Include="OpenTK" />
   </ItemGroup>
   <ItemGroup>
     <PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
     <Compile Include="NativeServices.cs" />
     <Compile Include="BrokenNativeControl.cs" />
     <Compile Include="CustomRenderers.cs" />
+    <Compile Include="PlatformSpecificCoreGalleryFactory.cs" />
     <Compile Include="RegistrarValidationService.cs" />
     <Compile Include="SampleNativeControl.cs" />
+    <Compile Include="..\Xamarin.Forms.Controls\GalleryPages\OpenGLGalleries\AdvancedOpenGLGallery.cs">
+      <Link>GalleryPages\AdvancedOpenGLGallery.cs</Link>
+    </Compile>
+    <Compile Include="..\Xamarin.Forms.Controls\GalleryPages\OpenGLGalleries\BasicOpenGLGallery.cs">
+      <Link>GalleryPages\BasicOpenGLGallery.cs</Link>
+    </Compile>
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\Xamarin.Forms.Controls\Xamarin.Forms.Controls.csproj">
diff --git a/Xamarin.Forms.ControlGallery.Tizen/PlatformSpecificCoreGalleryFactory.cs b/Xamarin.Forms.ControlGallery.Tizen/PlatformSpecificCoreGalleryFactory.cs
new file mode 100644 (file)
index 0000000..04d6275
--- /dev/null
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using Xamarin.Forms;
+using Xamarin.Forms.ControlGallery.Tizen;
+using Xamarin.Forms.Controls;
+
+[assembly: Dependency(typeof(PlatformSpecificCoreGalleryFactory))]
+
+namespace Xamarin.Forms.ControlGallery.Tizen
+{
+       public class PlatformSpecificCoreGalleryFactory : IPlatformSpecificCoreGalleryFactory
+       {
+               public string Title => "Tizen Core Gallery";
+
+               public IEnumerable<(Func<Page> Create, string Title)> GetPages() => null;
+       }
+}
diff --git a/Xamarin.Forms.ControlGallery.Tizen/StringProvider.cs b/Xamarin.Forms.ControlGallery.Tizen/StringProvider.cs
deleted file mode 100644 (file)
index 43816e0..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-using Xamarin.Forms;
-using Xamarin.Forms.Controls;
-using Xamarin.Forms.ControlGallery.Tizen;
-
-[assembly: Dependency(typeof(StringProvider))]
-namespace Xamarin.Forms.ControlGallery.Tizen
-{
-       public class StringProvider : IStringProvider
-       {
-               public string CoreGalleryTitle
-               {
-                       get
-                       {
-                               return "Tizen CoreGallery";
-                       }
-               }
-       }
-}
\ No newline at end of file
index ad0aecd..e3d8663 100644 (file)
@@ -7,7 +7,7 @@
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
         <assemblyIdentity name="OpenTK" publicKeyToken="bad199fe84eb3df4" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
+        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
       </dependentAssembly>
     </assemblyBinding>
   </runtime>
index 7a269ce..bffffa7 100644 (file)
@@ -13,7 +13,6 @@ namespace Xamarin.Forms.ControlGallery.WPF
                        Xamarin.Forms.Forms.Init();
                        FormsMaps.Init("");
                        LoadApplication(new Controls.App());
-            //LoadApplication(new OpenGLViewApp());
         }
        }
 }
diff --git a/Xamarin.Forms.ControlGallery.WPF/OpenGLViewApp.cs b/Xamarin.Forms.ControlGallery.WPF/OpenGLViewApp.cs
deleted file mode 100644 (file)
index 5fb48a1..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-using System;
-using OpenTK.Graphics.OpenGL;
-
-namespace Xamarin.Forms.ControlGallery.WPF
-{
-    public class OpenGLViewApp : Application
-    {
-        public OpenGLViewApp()
-        {
-            MainPage = new OpenGLViewSample();
-        }
-    }
-
-    public class OpenGLViewSample : ContentPage
-    {
-        private bool _initGl = false;
-        private int _viewportWidth;
-        private int _viewportHeight;
-        private uint _mProgramHandle;
-        private OpenGLView _openGLView = null;
-
-        public OpenGLViewSample()
-        {
-            Title = "OpenGLView Sample";
-
-            var titleLabel = new Label
-            {
-                Text = "OpenGLView",
-                FontSize = 36
-            };
-
-            _openGLView = new OpenGLView
-            {
-                HeightRequest = 300,
-                WidthRequest = 300,
-                HasRenderLoop = false
-            };
-
-            _openGLView.OnDisplay = r =>
-            {
-                if (!_initGl)
-                {
-                    double width_in_pixels = 300;
-                    double height_in_pixels = 300;
-
-                    InitGl((int)width_in_pixels, (int)height_in_pixels);
-                }
-
-                Render();
-            };
-
-            var stack = new StackLayout
-            {
-                Padding = new Size(12, 12),
-                Children = { titleLabel, _openGLView }
-            };
-
-            Content = stack;
-        }
-
-        void InitGl(int width, int height)
-        {
-            _viewportHeight = width;
-            _viewportWidth = height;
-
-            _mProgramHandle = (uint)GL.CreateProgram();
-            if (_mProgramHandle == 0)
-                throw new InvalidOperationException("Unable to create program");
-
-            GL.BindAttribLocation(_mProgramHandle, 0, "vPosition");
-            GL.LinkProgram(_mProgramHandle);
-
-            GL.Viewport(0, 0, _viewportWidth, _viewportHeight);
-
-            GL.UseProgram(_mProgramHandle);
-
-            _initGl = true;
-        }
-
-
-        void Render()
-        {
-            GL.ClearColor(0, 0, 0, 0);
-            GL.Clear(ClearBufferMask.ColorBufferBit);
-            GL.Color3(1.0f, 0.85f, 0.35f);
-            GL.Begin(BeginMode.Triangles);
-            GL.Vertex3(0.0, 0.6, 0.0);
-            GL.Vertex3(-0.2, -0.3, 0.0);
-            GL.Vertex3(0.2, -0.3, 0.0);
-            GL.End();
-            GL.Flush();
-        }
-    }
-
-    public class ReferenceTime
-    {
-        private static DateTime reference_time;
-        private static bool reference_time_set = false;
-
-        public static double GetTimeFromReferenceMs()
-        {
-            if (!reference_time_set)
-            {
-                reference_time = DateTime.Now;
-                reference_time_set = true;
-
-                return 0.0;
-            }
-
-            DateTime actual_time = DateTime.Now;
-            TimeSpan ts = new TimeSpan(actual_time.Ticks - reference_time.Ticks);
-
-            return ts.TotalMilliseconds;
-        }
-    }
-}
\ No newline at end of file
diff --git a/Xamarin.Forms.ControlGallery.WPF/OpenTK.dll.config b/Xamarin.Forms.ControlGallery.WPF/OpenTK.dll.config
deleted file mode 100644 (file)
index 7098d39..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<configuration>
-  <dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
-  <dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
-  <dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
-  <dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
-  <dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
-  <dllmap os="linux" dll="libX11" target="libX11.so.6"/>
-  <dllmap os="linux" dll="libXi" target="libXi.so.6"/>
-  <dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
-  <dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
-  <dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
-  <dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
-  <dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
-  <dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
-  <dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
-  <dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
-  <dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
-  <!-- XQuartz compatibility (X11 on Mac) -->
-  <dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
-  <dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
-  <dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
-  <dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
-  <dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
-  <dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
-</configuration>
diff --git a/Xamarin.Forms.ControlGallery.WPF/PlatformSpecificCoreGalleryFactory.cs b/Xamarin.Forms.ControlGallery.WPF/PlatformSpecificCoreGalleryFactory.cs
new file mode 100644 (file)
index 0000000..333acc2
--- /dev/null
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using Xamarin.Forms;
+using Xamarin.Forms.ControlGallery.WPF;
+using Xamarin.Forms.Controls;
+
+[assembly: Dependency(typeof(PlatformSpecificCoreGalleryFactory))]
+
+namespace Xamarin.Forms.ControlGallery.WPF
+{
+       public class PlatformSpecificCoreGalleryFactory : IPlatformSpecificCoreGalleryFactory
+       {
+               public string Title => "WPF Core Gallery";
+
+               public IEnumerable<(Func<Page> Create, string Title)> GetPages()
+               {
+#if HAVE_OPENTK
+                       yield return (() => new BasicOpenGLGallery(), "Basic OpenGL Gallery - Legacy");
+                       yield return (() => new AdvancedOpenGLGallery(), "Advanced OpenGL Gallery - Legacy");
+#else
+                       return null;
+#endif
+               }
+       }
+}
diff --git a/Xamarin.Forms.ControlGallery.WPF/StringProvider.cs b/Xamarin.Forms.ControlGallery.WPF/StringProvider.cs
deleted file mode 100644 (file)
index f0d8bed..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Xamarin.Forms;
-using Xamarin.Forms.ControlGallery.WPF;
-using Xamarin.Forms.Controls;
-
-[assembly: Dependency(typeof(StringProvider))]
-namespace Xamarin.Forms.ControlGallery.WPF
-{
-       public class StringProvider : IStringProvider
-       {
-               public string CoreGalleryTitle
-               {
-                       get { return "WPF Core Gallery"; }
-               }
-       }
-}
index 79e90cf..81fa280 100644 (file)
@@ -20,7 +20,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DefineConstants>DEBUG;TRACE;HAVE_OPENTK;__WPF__</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -30,7 +30,7 @@
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
+    <DefineConstants>TRACE;HAVE_OPENTK;__WPF__</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   <ItemGroup>
     <PackageReference Include="Meziantou.WpfFontAwesome" Version="4.7.0" />
     <PackageReference Include="Microsoft.Maps.MapControl.WPF" Version="1.0.0.3" />
-    <PackageReference Include="OpenTK" Version="2.0.0" />
-    <PackageReference Include="OpenTK.GLControl" Version="1.1.2349.61993" />
+    <PackageReference Include="OpenTK" Version="3.0.1" />
+    <PackageReference Include="OpenTK.GLControl" Version="3.0.1" />
   </ItemGroup>
   <ItemGroup>
     <ApplicationDefinition Include="App.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </ApplicationDefinition>
-    <Compile Include="OpenGLViewApp.cs" />
+    <Compile Include="..\Xamarin.Forms.Controls\GalleryPages\OpenGLGalleries\AdvancedOpenGLGallery.cs">
+      <Link>GalleryPages\AdvancedOpenGLGallery.cs</Link>
+    </Compile>
+    <Compile Include="..\Xamarin.Forms.Controls\GalleryPages\OpenGLGalleries\BasicOpenGLGallery.cs">
+      <Link>GalleryPages\BasicOpenGLGallery.cs</Link>
+    </Compile>
+    <Compile Include="PlatformSpecificCoreGalleryFactory.cs" />
     <Compile Include="RegistrarValidationService.cs" />
     <Compile Include="SampleNativeControl.cs" />
-    <Compile Include="StringProvider.cs" />
     <Page Include="MainWindow.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </EmbeddedResource>
     <Resource Include="Assets\fontawesome-webfont.ttf" />
     <Resource Include="Assets\pickax.ttf" />
-    <None Include="OpenTK.dll.config">
-      <SubType>Designer</SubType>
-    </None>
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
diff --git a/Xamarin.Forms.ControlGallery.WindowsUniversal/PlatformSpecificCoreGalleryFactory.cs b/Xamarin.Forms.ControlGallery.WindowsUniversal/PlatformSpecificCoreGalleryFactory.cs
new file mode 100644 (file)
index 0000000..a5a9b3b
--- /dev/null
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using Xamarin.Forms;
+using Xamarin.Forms.ControlGallery.WindowsUniversal;
+using Xamarin.Forms.Controls;
+
+[assembly: Dependency(typeof(PlatformSpecificCoreGalleryFactory))]
+
+namespace Xamarin.Forms.ControlGallery.WindowsUniversal
+{
+       public class PlatformSpecificCoreGalleryFactory : IPlatformSpecificCoreGalleryFactory
+       {
+               public string Title => "Windows Core Gallery";
+
+               public IEnumerable<(Func<Page> Create, string Title)> GetPages() => null;
+       }
+}
diff --git a/Xamarin.Forms.ControlGallery.WindowsUniversal/StringProvider.cs b/Xamarin.Forms.ControlGallery.WindowsUniversal/StringProvider.cs
deleted file mode 100644 (file)
index 0d109d7..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-using Xamarin.Forms;
-using Xamarin.Forms.ControlGallery.WindowsUniversal;
-using Xamarin.Forms.Controls;
-
-[assembly: Dependency (typeof (StringProvider))]
-
-namespace Xamarin.Forms.ControlGallery.WindowsUniversal
-{
-       public class StringProvider : IStringProvider
-       {
-               public string CoreGalleryTitle {
-                       get { return "Windows Core Gallery"; }
-               }
-       }
-}
index 222a9ee..e8427a5 100644 (file)
     <Compile Include="AttachedStateEffectRenderer.cs" />
     <Compile Include="BorderEffect.cs" />
     <Compile Include="DisposePageRenderer.cs" />
+    <Compile Include="PlatformSpecificCoreGalleryFactory.cs" />
     <Compile Include="RegistrarValidationService.cs" />
     <Compile Include="SampleNativeControl.cs" />
     <Compile Include="_2489CustomRenderer.cs" />
     <Content Include="Assets\Fonts\Lobster-Regular.ttf" />
     <Content Include="Properties\default.rd.xml" />
     <Compile Include="BrokenImageSourceHandler.cs" />
-    <Compile Include="StringProvider.cs" />
     <Compile Include="App.xaml.cs">
       <DependentUpon>App.xaml</DependentUpon>
     </Compile>
index 4e07f28..c8560a6 100644 (file)
@@ -12,7 +12,6 @@ using Xamarin.Forms.Controls.Issues;
 using Xamarin.Forms.Platform.iOS;
 
 [assembly: Dependency(typeof(TestCloudService))]
-[assembly: Dependency(typeof(StringProvider))]
 [assembly: Dependency(typeof(CacheService))]
 [assembly: ExportRenderer(typeof(DisposePage), typeof(DisposePageRenderer))]
 [assembly: ExportRenderer(typeof(DisposeLabel), typeof(DisposeLabelRenderer))]
@@ -75,14 +74,6 @@ namespace Xamarin.Forms.ControlGallery.iOS
                }
        }
 
-       public class StringProvider : IStringProvider
-       {
-               public string CoreGalleryTitle
-               {
-                       get { return "iOS Core Gallery"; }
-               }
-       }
-
        public class TestCloudService : ITestCloudService
        {
                public bool IsOnTestCloud()
diff --git a/Xamarin.Forms.ControlGallery.iOS/PlatformSpecificCoreGalleryFactory.cs b/Xamarin.Forms.ControlGallery.iOS/PlatformSpecificCoreGalleryFactory.cs
new file mode 100644 (file)
index 0000000..4c47e12
--- /dev/null
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using Xamarin.Forms;
+using Xamarin.Forms.ControlGallery.iOS;
+using Xamarin.Forms.Controls;
+
+[assembly: Dependency(typeof(PlatformSpecificCoreGalleryFactory))]
+
+namespace Xamarin.Forms.ControlGallery.iOS
+{
+       public class PlatformSpecificCoreGalleryFactory : IPlatformSpecificCoreGalleryFactory
+       {
+               public string Title => "iOS Core Gallery";
+
+               public IEnumerable<(Func<Page> Create, string Title)> GetPages()
+               {
+#if HAVE_OPENTK
+                       yield return (() => new AdvancedOpenGLGallery(), "Advanced OpenGL Gallery - Legacy");
+#else
+                       return null;
+#endif
+               }
+       }
+}
index edde14d..28bc92c 100644 (file)
@@ -17,7 +17,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
-    <DefineConstants>DEBUG</DefineConstants>
+    <DefineConstants>DEBUG;HAVE_OPENTK</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <ConsolePause>false</ConsolePause>
     <MtouchFloat32>False</MtouchFloat32>
     <CodesignKey>iPhone Developer</CodesignKey>
     <CodesignProvision />
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>bin\iPhoneSimulator\Release</OutputPath>
+    <DefineConstants>HAVE_OPENTK</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <MtouchLink>None</MtouchLink>
     <MtouchArch>i386, x86_64</MtouchArch>
     <ConsolePause>false</ConsolePause>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
     <DebugSymbols>true</DebugSymbols>
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\iPhone\Debug</OutputPath>
-    <DefineConstants>DEBUG;__UNIFIED__;__MOBILE__;__IOS__</DefineConstants>
+    <DefineConstants>DEBUG;__UNIFIED__;__MOBILE__;__IOS__;HAVE_OPENTK</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <ConsolePause>false</ConsolePause>
     <CodesignExtraArgs />
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     <MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>bin\iPhone\Release</OutputPath>
+    <DefineConstants>HAVE_OPENTK</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <MtouchArch>ARMv7, ARM64</MtouchArch>
@@ -93,6 +98,7 @@
     <CodesignKey>iPhone Developer</CodesignKey>
     <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(RunConfiguration)' == 'Default' ">
     <AppExtensionDebugBundleId />
     <Compile Include="AttachedStateEffectRenderer.cs" />
     <Compile Include="BrokenImageSourceHandler.cs" />
     <Compile Include="BrokenNativeControl.cs" />
+    <Compile Include="PlatformSpecificCoreGalleryFactory.cs" />
     <Compile Include="SearchbarEffect.cs" />
     <Compile Include="CustomRenderer40251.cs" />
     <Compile Include="Main.cs" />
     <Compile Include="CustomRenderers.cs" />
     <Compile Include="CustomRendererBugzila38731.cs" />
     <Compile Include="CustomApplication.cs" />
+    <Compile Include="..\xamarin.forms.controls\gallerypages\openglgalleries\AdvancedOpenGLGallery.cs">
+      <Link>GalleryPages\AdvancedOpenGLGallery.cs</Link>
+    </Compile>
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\Xamarin.Forms.Controls\Xamarin.Forms.Controls.csproj">
     <Reference Include="System.Core" />
     <Reference Include="Xamarin.iOS" />
     <Reference Include="netstandard" />
+    <Reference Include="OpenTK-1.0" />
   </ItemGroup>
   <ItemGroup>
     <PackageReference Include="AdvancedColorPicker" Version="2.0.1" />
index f0edad6..4ceb394 100644 (file)
@@ -370,7 +370,8 @@ namespace Xamarin.Forms.Controls
                                new GalleryPageFactory(() => new MultiGallery(), "Multi Gallery - Legacy"),
                                new GalleryPageFactory(() => new NavigationPropertiesGallery(), "Navigation Properties"),
 #if HAVE_OPENTK
-                               new GalleryPageFactory(() => new OpenGLGallery(), "OpenGLGallery - Legacy"),
+                               new GalleryPageFactory(() => new BasicOpenGLGallery(), "Basic OpenGL Gallery - Legacy"),
+                               new GalleryPageFactory(() => new AdvancedOpenGLGallery(), "Advanced OpenGL Gallery - Legacy"),
 #endif
                                new GalleryPageFactory(() => new PickerGallery(), "Picker Gallery - Legacy"),
                                new GalleryPageFactory(() => new ProgressBarGallery(), "ProgressBar Gallery - Legacy"),
@@ -396,6 +397,12 @@ namespace Xamarin.Forms.Controls
 
                public CorePageView(Page rootPage, NavigationBehavior navigationBehavior = NavigationBehavior.PushAsync)
                {
+                       var galleryFactory = DependencyService.Get<IPlatformSpecificCoreGalleryFactory>();
+
+                       var platformPages = galleryFactory?.GetPages();
+                       if (platformPages != null)
+                               _pages.AddRange(platformPages.Select(p => new GalleryPageFactory(p.Create, p.Title + " (Platform Specifc)")));
+
                        _titleToPage = _pages.ToDictionary(o => o.Title);
 
                        // avoid NRE for root pages without NavigationBar
@@ -492,9 +499,9 @@ namespace Xamarin.Forms.Controls
                {
                        ValidateRegistrar();
 
-                       IStringProvider stringProvider = DependencyService.Get<IStringProvider>();
+                       var galleryFactory = DependencyService.Get<IPlatformSpecificCoreGalleryFactory>();
 
-                       Title = stringProvider.CoreGalleryTitle;
+                       Title = galleryFactory?.Title ?? "Core Gallery";
 
                        var corePageView = new CorePageView(rootPage, navigationBehavior);
 
@@ -568,9 +575,11 @@ namespace Xamarin.Forms.Controls
        }
 
        [Preserve(AllMembers = true)]
-       public interface IStringProvider
+       public interface IPlatformSpecificCoreGalleryFactory
        {
-               string CoreGalleryTitle { get; }
+               string Title { get; }
+
+               IEnumerable<(Func<Page> Create, string Title)> GetPages();
        }
        [Preserve(AllMembers = true)]
        public static class CoreGallery
@@ -1,18 +1,16 @@
-using OpenTK;
-using OpenTK.Graphics.OpenGL;
+#if HAVE_OPENTK
 using System;
+using OpenTK;
 
-namespace Xamarin.Forms.ControlGallery.GTK
-{
-    public class AdvancedOpenGLApp : Application
-    {
-        public AdvancedOpenGLApp()
-        {
-            MainPage = new AdvancedOpenGLView();
-        }
-    }
+#if __WPF__ || __GTK__ || __MACOS__
+using OpenTK.Graphics.OpenGL;
+#elif __ANDROID__ || __IOS__
+using OpenTK.Graphics.ES20;
+#endif
 
-    public class AdvancedOpenGLView : ContentPage
+namespace Xamarin.Forms.Controls
+{
+    public class AdvancedOpenGLGallery : ContentPage
     {
         private const string VertexShader = @"
             uniform mat4 uMVPMatrix;
@@ -48,7 +46,7 @@ namespace Xamarin.Forms.ControlGallery.GTK
 
         private Xamarin.Forms.OpenGLView _openGLView = null;
 
-        public AdvancedOpenGLView()
+        public AdvancedOpenGLGallery()
         {
             Title = "Advanced OpenGLView Sample";
 
@@ -212,4 +210,5 @@ namespace Xamarin.Forms.ControlGallery.GTK
             return ts.TotalMilliseconds;
         }
     }
-}
\ No newline at end of file
+}
+#endif
\ No newline at end of file
@@ -1,17 +1,10 @@
-using System;
+#if HAVE_OPENTK
+using System;
 using OpenTK.Graphics.OpenGL;
 
-namespace Xamarin.Forms.ControlGallery.GTK
+namespace Xamarin.Forms.Controls
 {
-    public class BasicOpenGLApp : Application
-    {
-        public BasicOpenGLApp()
-        {
-            MainPage = new BasicOpenGLView();
-        }
-    }
-
-    public class BasicOpenGLView : ContentPage
+    public class BasicOpenGLGallery : ContentPage
     {
         private bool _initGl = false;
         private int _viewportWidth;
@@ -19,7 +12,7 @@ namespace Xamarin.Forms.ControlGallery.GTK
         private uint _mProgramHandle;
         private OpenGLView _openGLView = null;
 
-        public BasicOpenGLView()
+        public BasicOpenGLGallery()
         {
             Title = "Basic OpenGLView Sample";
 
@@ -95,4 +88,5 @@ namespace Xamarin.Forms.ControlGallery.GTK
             GL.Flush();
         }
     }
-}
\ No newline at end of file
+}
+#endif
\ No newline at end of file
diff --git a/Xamarin.Forms.Controls/GalleryPages/OpenGLGallery.cs b/Xamarin.Forms.Controls/GalleryPages/OpenGLGallery.cs
deleted file mode 100644 (file)
index bb5ce8a..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-#if HAVE_OPENTK
-using OpenTK.Graphics;
-using OpenTK.Graphics.ES20;
-#endif
-
-namespace Xamarin.Forms.Controls
-{
-#if HAVE_OPENTK
-       public class OpenGLGallery : ContentPage
-       {
-               float red, green, blue;
-
-               public OpenGLGallery ()
-               {
-                       var view = new OpenGLView {HasRenderLoop = true};
-                       var toggle = new Switch {IsToggled = true};
-                       var button = new Button {Text = "Display"};
-
-                       view.HeightRequest = 300;
-                       view.WidthRequest = 300;
-
-                       view.OnDisplay = r =>{
-                               /*
-                               if (!inited) {
-                                       var shader = GL.CreateShader (All.VertexShader);
-                                       int length = 0;
-                                       GL.ShaderSource (shader, 1, new string [] { "void main() { gl_FragColor = vec4(0.6, 1.0, 0.0, 1.0); }"}, ref length);
-                                       GL.CompileShader (shader);
-                                       int status = 0;
-                                       GL.GetShader (shader, All.CompileStatus, ref status);
-                                       if (status == 0) {
-                                               GL.DeleteShader (shader);
-                                               throw new Exception();
-                                       }
-
-                                       inited = true;
-                               }
-                                */
-                               GL.ClearColor (red, green, blue, 1.0f);
-                               GL.Clear ((ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit));
-
-                               red += 0.01f;
-                               if (red >= 1.0f)
-                                       red -= 1.0f;
-                               green += 0.02f;
-                               if (green >= 1.0f)
-                                       green -= 1.0f;
-                               blue += 0.03f;
-                               if (blue >= 1.0f)
-                                       blue -= 1.0f;
-                       };
-
-                       toggle.Toggled += (s, a) => { view.HasRenderLoop = toggle.IsToggled; };
-                       button.Activated += (s, a) => view.Display ();
-
-                       var stack = new StackLayout {Padding = new Size (20, 20)};
-                       stack.Add (view);
-                       stack.Add (toggle);
-                       stack.Add (button);
-
-                       Content = stack;
-               }
-       }
-#endif
-}
index 3f14a07..9142b7e 100644 (file)
@@ -5,10 +5,6 @@ using System.Linq;
 using System.Resources;
 using System.Text;
 using System.Threading.Tasks;
-#if HAVE_OPENTK
-using OpenTK.Graphics;
-using OpenTK.Graphics.ES20;
-#endif
 
 namespace Xamarin.Forms.Controls
 {
index 4777f37..f214d26 100644 (file)
@@ -6,10 +6,6 @@
         <assemblyIdentity name="Mono.Cairo" publicKeyToken="0738eb9f132ed756" culture="neutral"/>
         <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
       </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="OpenTK" publicKeyToken="bad199fe84eb3df4" culture="neutral"/>
-        <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
-      </dependentAssembly>
     </assemblyBinding>
   </runtime>
 <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7"/></startup></configuration>
index 6a81675..9e6d70a 100644 (file)
@@ -73,7 +73,6 @@
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     </EmbeddedResource>
-    <None Include="app.config" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
diff --git a/Xamarin.Forms.Maps.WPF/app.config b/Xamarin.Forms.Maps.WPF/app.config
deleted file mode 100644 (file)
index d4f722e..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
-  <runtime>
-    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
-      <dependentAssembly>
-        <assemblyIdentity name="OpenTK" publicKeyToken="bad199fe84eb3df4" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
-      </dependentAssembly>
-    </assemblyBinding>
-  </runtime>
-</configuration>
\ No newline at end of file
diff --git a/Xamarin.Forms.Platform.GTK/Libs/OpenTK/OpenTK.dll b/Xamarin.Forms.Platform.GTK/Libs/OpenTK/OpenTK.dll
deleted file mode 100644 (file)
index 74955ba..0000000
Binary files a/Xamarin.Forms.Platform.GTK/Libs/OpenTK/OpenTK.dll and /dev/null differ
diff --git a/Xamarin.Forms.Platform.GTK/Libs/OpenTK/OpenTK.dll.config b/Xamarin.Forms.Platform.GTK/Libs/OpenTK/OpenTK.dll.config
deleted file mode 100644 (file)
index 7098d39..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<configuration>
-  <dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
-  <dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
-  <dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
-  <dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
-  <dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
-  <dllmap os="linux" dll="libX11" target="libX11.so.6"/>
-  <dllmap os="linux" dll="libXi" target="libXi.so.6"/>
-  <dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
-  <dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
-  <dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
-  <dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
-  <dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
-  <dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
-  <dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
-  <dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
-  <dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
-  <!-- XQuartz compatibility (X11 on Mac) -->
-  <dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
-  <dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
-  <dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
-  <dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
-  <dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
-  <dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
-</configuration>
diff --git a/Xamarin.Forms.Platform.GTK/Libs/OpenTK/README.txt b/Xamarin.Forms.Platform.GTK/Libs/OpenTK/README.txt
deleted file mode 100644 (file)
index 6ff2316..0000000
+++ /dev/null
@@ -1 +0,0 @@
-https://github.com/opentk/opentk
\ No newline at end of file
index 7da144d..559e92e 100644 (file)
       <HintPath>Libs\gtk-sharp\Mono.Cairo\Mono.Cairo.dll</HintPath>
       <Private>False</Private>
     </Reference>
-    <Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>Libs\OpenTK\OpenTK.dll</HintPath>
-    </Reference>
     <Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>Libs\gtk-sharp\gtk-sharp-2.0\pango-sharp.dll</HintPath>
@@ -93,6 +89,9 @@
     </Reference>
   </ItemGroup>
   <ItemGroup>
+    <PackageReference Include="OpenTK" Version="3.0.1" />
+  </ItemGroup>
+  <ItemGroup>
     <Compile Include="..\Xamarin.Forms.Core\Properties\GlobalAssemblyInfo.cs">
       <Link>Properties\GlobalAssemblyInfo.cs</Link>
     </Compile>
     <Content Include="Libs\gtk-sharp\Mono.Cairo\Mono.Cairo.dll" />
     <Content Include="Libs\gtk-sharp\Mono.Posix\Mono.Posix.dll" />
     <Content Include="Libs\gtk-sharp\README.txt" />
-    <Content Include="Libs\OpenTK\OpenTK.dll" />
-    <Content Include="Libs\OpenTK\README.txt" />
     <Content Include="Libs\webkit-sharp\webkit-sharp.dll.config" />
-    <None Include="Libs\OpenTK\OpenTK.dll.config" />
     <None Include="webkit-sharp.dll.config">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
diff --git a/Xamarin.Forms.Platform.WPF/OpenTK.dll.config b/Xamarin.Forms.Platform.WPF/OpenTK.dll.config
deleted file mode 100644 (file)
index 7098d39..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<configuration>
-  <dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
-  <dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
-  <dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
-  <dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
-  <dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
-  <dllmap os="linux" dll="libX11" target="libX11.so.6"/>
-  <dllmap os="linux" dll="libXi" target="libXi.so.6"/>
-  <dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
-  <dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
-  <dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
-  <dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
-  <dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
-  <dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
-  <dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
-  <dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
-  <dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
-  <!-- XQuartz compatibility (X11 on Mac) -->
-  <dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
-  <dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
-  <dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
-  <dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
-  <dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
-  <dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
-</configuration>
index 6dd879c..813a7ee 100644 (file)
@@ -53,8 +53,8 @@
     <Reference Include="WindowsFormsIntegration" />
   </ItemGroup>
   <ItemGroup>
-    <PackageReference Include="OpenTK" Version="2.0.0" />
-    <PackageReference Include="OpenTK.GLControl" Version="1.1.2349.61993" />
+    <PackageReference Include="OpenTK" Version="3.0.1" />
+    <PackageReference Include="OpenTK.GLControl" Version="3.0.1" />
   </ItemGroup>
   <ItemGroup>
     <Compile Include="..\Xamarin.Forms.Platform.UAP\TextBlockExtensions.cs">
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     </EmbeddedResource>
     <None Include="app.config" />
-    <None Include="OpenTK.dll.config">
-      <SubType>Designer</SubType>
-    </None>
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
index d4f722e..90cfbda 100644 (file)
@@ -4,7 +4,7 @@
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
         <assemblyIdentity name="OpenTK" publicKeyToken="bad199fe84eb3df4" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
+        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
       </dependentAssembly>
     </assemblyBinding>
   </runtime>