From ec36b5754c96ec46ff5380c86a28869ffe353c16 Mon Sep 17 00:00:00 2001 From: varon Date: Fri, 15 Jul 2016 13:33:33 +0200 Subject: [PATCH] Removed OpenTK Samples --- .../Android/ES11/Assets/AboutAssets.txt | 19 - Source/Samples/Android/ES11/ES11.csproj | 72 ---- Source/Samples/Android/ES11/GLView1.cs | 109 ------ Source/Samples/Android/ES11/MainActivity.cs | 51 --- .../ES11/Properties/AndroidManifest.xml | 6 - .../Android/ES11/Properties/AssemblyInfo.cs | 23 -- .../Android/ES11/Resources/AboutResources.txt | 44 --- .../ES11/Resources/Resource.designer.cs | 93 ----- .../Android/ES11/Resources/drawable/Icon.png | Bin 2574 -> 0 bytes .../Android/ES11/Resources/layout/Main.axml | 8 - .../Android/ES11/Resources/values/Strings.xml | 4 - Source/Samples/iOS/ES11/AppDelegate.cs | 42 --- Source/Samples/iOS/ES11/EAGLView.cs | 351 ------------------ Source/Samples/iOS/ES11/ES11.csproj | 126 ------- Source/Samples/iOS/ES11/Entitlements.plist | 6 - Source/Samples/iOS/ES11/Info.plist | 44 --- Source/Samples/iOS/ES11/Main.cs | 20 - .../iOS/ES11/MainStoryboard_iPad.storyboard | 26 -- .../iOS/ES11/MainStoryboard_iPhone.storyboard | 26 -- .../Samples/iOS/ES11/OpenGLViewController.cs | 71 ---- .../iOS/ES11/Resources/Default-568h@2x.png | Bin 2215 -> 0 bytes Source/Samples/iOS/ES11/Shader.fsh | 6 - Source/Samples/iOS/ES11/Shader.vsh | 14 - 23 files changed, 1161 deletions(-) delete mode 100644 Source/Samples/Android/ES11/Assets/AboutAssets.txt delete mode 100644 Source/Samples/Android/ES11/ES11.csproj delete mode 100644 Source/Samples/Android/ES11/GLView1.cs delete mode 100644 Source/Samples/Android/ES11/MainActivity.cs delete mode 100644 Source/Samples/Android/ES11/Properties/AndroidManifest.xml delete mode 100644 Source/Samples/Android/ES11/Properties/AssemblyInfo.cs delete mode 100644 Source/Samples/Android/ES11/Resources/AboutResources.txt delete mode 100644 Source/Samples/Android/ES11/Resources/Resource.designer.cs delete mode 100644 Source/Samples/Android/ES11/Resources/drawable/Icon.png delete mode 100644 Source/Samples/Android/ES11/Resources/layout/Main.axml delete mode 100644 Source/Samples/Android/ES11/Resources/values/Strings.xml delete mode 100644 Source/Samples/iOS/ES11/AppDelegate.cs delete mode 100644 Source/Samples/iOS/ES11/EAGLView.cs delete mode 100644 Source/Samples/iOS/ES11/ES11.csproj delete mode 100644 Source/Samples/iOS/ES11/Entitlements.plist delete mode 100644 Source/Samples/iOS/ES11/Info.plist delete mode 100644 Source/Samples/iOS/ES11/Main.cs delete mode 100644 Source/Samples/iOS/ES11/MainStoryboard_iPad.storyboard delete mode 100644 Source/Samples/iOS/ES11/MainStoryboard_iPhone.storyboard delete mode 100644 Source/Samples/iOS/ES11/OpenGLViewController.cs delete mode 100644 Source/Samples/iOS/ES11/Resources/Default-568h@2x.png delete mode 100644 Source/Samples/iOS/ES11/Shader.fsh delete mode 100644 Source/Samples/iOS/ES11/Shader.vsh diff --git a/Source/Samples/Android/ES11/Assets/AboutAssets.txt b/Source/Samples/Android/ES11/Assets/AboutAssets.txt deleted file mode 100644 index a9b0638e..00000000 --- a/Source/Samples/Android/ES11/Assets/AboutAssets.txt +++ /dev/null @@ -1,19 +0,0 @@ -Any raw assets you want to be deployed with your application can be placed in -this directory (and child directories) and given a Build Action of "AndroidAsset". - -These files will be deployed with your package and will be accessible using Android's -AssetManager, like this: - -public class ReadAsset : Activity -{ - protected override void OnCreate (Bundle bundle) - { - base.OnCreate (bundle); - - InputStream input = Assets.Open ("my_asset.txt"); - } -} - -Additionally, some Android functions will automatically load asset files: - -Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); diff --git a/Source/Samples/Android/ES11/ES11.csproj b/Source/Samples/Android/ES11/ES11.csproj deleted file mode 100644 index 1f472fb6..00000000 --- a/Source/Samples/Android/ES11/ES11.csproj +++ /dev/null @@ -1,72 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {61E47728-8B64-442E-89EA-1FE6D2ADE654} - {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - ES11 - True - Resources\Resource.designer.cs - Resource - Resources - Assets - False - ES11 - Properties\AndroidManifest.xml - - - true - full - false - bin\Debug - DEBUG;__MOBILE__;__ANDROID__; - prompt - 4 - None - false - - - full - true - bin\Release - __MOBILE__;__ANDROID__; - prompt - 4 - false - false - Full - - - - - - - - - - - - - - - - - - - - - - - - - - - {1648ACE1-E7D0-41CB-9A0E-C2A9D76C13A9} - OpenTK.Android - - - \ No newline at end of file diff --git a/Source/Samples/Android/ES11/GLView1.cs b/Source/Samples/Android/ES11/GLView1.cs deleted file mode 100644 index 1d82babe..00000000 --- a/Source/Samples/Android/ES11/GLView1.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using OpenTK; -using OpenTK.Graphics; -using OpenTK.Graphics.ES11; -using OpenTK.Platform; -using OpenTK.Platform.Android; -using Android.Views; -using Android.Content; -using Android.Util; - -namespace ES11 -{ - - class GLView1 : AndroidGameView - { - public GLView1(Context context) : base(context) - { - } - // This gets called when the drawing surface is ready - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - - // Run the render loop - Run(); - } - // This method is called everytime the context needs - // to be recreated. Use it to set any egl-specific settings - // prior to context creation - // - // In this particular case, we demonstrate how to set - // the graphics mode and fallback in case the device doesn't - // support the defaults - protected override void CreateFrameBuffer() - { - // the default GraphicsMode that is set consists of (16, 16, 0, 0, 2, false) - try - { - Log.Verbose("GLCube", "Loading with default settings"); - - // if you don't call this, the context won't be created - base.CreateFrameBuffer(); - return; - } - catch (Exception ex) - { - Log.Verbose("GLCube", "{0}", ex); - } - - // this is a graphics setting that sets everything to the lowest mode possible so - // the device returns a reliable graphics setting. - try - { - Log.Verbose("GLCube", "Loading with custom Android settings (low mode)"); - GraphicsMode = new AndroidGraphicsMode(0, 0, 0, 0, 0, false); - - // if you don't call this, the context won't be created - base.CreateFrameBuffer(); - return; - } - catch (Exception ex) - { - Log.Verbose("GLCube", "{0}", ex); - } - throw new Exception("Can't load egl, aborting"); - } - // This gets called on each frame render - protected override void OnRenderFrame(FrameEventArgs e) - { - // you only need to call this if you have delegates - // registered that you want to have called - base.OnRenderFrame(e); - - GL.MatrixMode(All.Projection); - GL.LoadIdentity(); - GL.Ortho(-1.0f, 1.0f, -1.5f, 1.5f, -1.0f, 1.0f); - GL.MatrixMode(All.Modelview); - GL.Rotate(3.0f, 0.0f, 0.0f, 1.0f); - - GL.ClearColor(0.5f, 0.5f, 0.5f, 1.0f); - GL.Clear(ClearBufferMask.ColorBufferBit); - - GL.VertexPointer(2, All.Float, 0, square_vertices); - GL.EnableClientState(All.VertexArray); - GL.ColorPointer(4, All.UnsignedByte, 0, square_colors); - GL.EnableClientState(All.ColorArray); - - GL.DrawArrays(All.TriangleStrip, 0, 4); - - SwapBuffers(); - } - - float[] square_vertices = - { - -0.5f, -0.5f, - 0.5f, -0.5f, - -0.5f, 0.5f, - 0.5f, 0.5f, - }; - byte[] square_colors = - { - 255, 255, 0, 255, - 0, 255, 255, 255, - 0, 0, 0, 0, - 255, 0, 255, 255, - }; - } -} - diff --git a/Source/Samples/Android/ES11/MainActivity.cs b/Source/Samples/Android/ES11/MainActivity.cs deleted file mode 100644 index 023296ff..00000000 --- a/Source/Samples/Android/ES11/MainActivity.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using Android.App; -using Android.Content; -using Android.Runtime; -using Android.Views; -using Android.Widget; -using Android.OS; -using Android.Content.PM; - -namespace ES11 -{ - - // the ConfigurationChanges flags set here keep the EGL context - // from being destroyed whenever the device is rotated or the - // keyboard is shown (highly recommended for all GL apps) - [Activity(Label = "ES11", - #if __ANDROID_11__ - HardwareAccelerated=false, - #endif - ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.KeyboardHidden, - MainLauncher = true)] - public class MainActivity : Activity - { - GLView1 view; - - protected override void OnCreate(Bundle bundle) - { - base.OnCreate(bundle); - - // Create our OpenGL view, and display it - view = new GLView1(this); - SetContentView(view); - } - - protected override void OnPause() - { - // never forget to do this! - base.OnPause(); - view.Pause(); - } - - protected override void OnResume() - { - // never forget to do this! - base.OnResume(); - view.Resume(); - } - } -} - - diff --git a/Source/Samples/Android/ES11/Properties/AndroidManifest.xml b/Source/Samples/Android/ES11/Properties/AndroidManifest.xml deleted file mode 100644 index 7dcacb70..00000000 --- a/Source/Samples/Android/ES11/Properties/AndroidManifest.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Source/Samples/Android/ES11/Properties/AssemblyInfo.cs b/Source/Samples/Android/ES11/Properties/AssemblyInfo.cs deleted file mode 100644 index ca2c5b55..00000000 --- a/Source/Samples/Android/ES11/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using Android.App; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. -[assembly: AssemblyTitle("ES11")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("Stefanos Apostolopoulos")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion("1.0.0")] -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] - diff --git a/Source/Samples/Android/ES11/Resources/AboutResources.txt b/Source/Samples/Android/ES11/Resources/AboutResources.txt deleted file mode 100644 index 10f52d46..00000000 --- a/Source/Samples/Android/ES11/Resources/AboutResources.txt +++ /dev/null @@ -1,44 +0,0 @@ -Images, layout descriptions, binary blobs and string dictionaries can be included -in your application as resource files. Various Android APIs are designed to -operate on the resource IDs instead of dealing with images, strings or binary blobs -directly. - -For example, a sample Android app that contains a user interface layout (main.axml), -an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) -would keep its resources in the "Resources" directory of the application: - -Resources/ - drawable/ - icon.png - - layout/ - main.axml - - values/ - strings.xml - -In order to get the build system to recognize Android resources, set the build action to -"AndroidResource". The native Android APIs do not operate directly with filenames, but -instead operate on resource IDs. When you compile an Android application that uses resources, -the build system will package the resources for distribution and generate a class called "R" -(this is an Android convention) that contains the tokens for each one of the resources -included. For example, for the above Resources layout, this is what the R class would expose: - -public class R { - public class drawable { - public const int icon = 0x123; - } - - public class layout { - public const int main = 0x456; - } - - public class strings { - public const int first_string = 0xabc; - public const int second_string = 0xbcd; - } -} - -You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main -to reference the layout/main.axml file, or R.strings.first_string to reference the first -string in the dictionary file values/strings.xml. diff --git a/Source/Samples/Android/ES11/Resources/Resource.designer.cs b/Source/Samples/Android/ES11/Resources/Resource.designer.cs deleted file mode 100644 index d3a81b32..00000000 --- a/Source/Samples/Android/ES11/Resources/Resource.designer.cs +++ /dev/null @@ -1,93 +0,0 @@ -#pragma warning disable 1591 -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -[assembly: global::Android.Runtime.ResourceDesignerAttribute("ES11.Resource", IsApplication=true)] - -namespace ES11 -{ - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] - public partial class Resource - { - - static Resource() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - - public static void UpdateIdValues() - { - } - - public partial class Attribute - { - - static Attribute() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - - private Attribute() - { - } - } - - public partial class Drawable - { - - // aapt resource value: 0x7f020000 - public const int Icon = 2130837504; - - static Drawable() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - - private Drawable() - { - } - } - - public partial class Layout - { - - // aapt resource value: 0x7f030000 - public const int Main = 2130903040; - - static Layout() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - - private Layout() - { - } - } - - public partial class String - { - - // aapt resource value: 0x7f040000 - public const int app_name = 2130968576; - - static String() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - - private String() - { - } - } - } -} -#pragma warning restore 1591 diff --git a/Source/Samples/Android/ES11/Resources/drawable/Icon.png b/Source/Samples/Android/ES11/Resources/drawable/Icon.png deleted file mode 100644 index a07c69fa5a0f4da5d5efe96eea12a543154dbab6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2574 zcmV+p3i0)cP)Q`Og{P|8RRXpj5bgrSmEzSMfBn+{{vpNxw?;5UX;iv9sYxy_`IQHs$i<61a_iv^L>h8s-`D(`e@|IgS*Fj zNGM876Gf;3D8*1UX9a%v>yJKD*QkCwW2AirU(L{qNA)JghmGItc;(H<$!ABY&gBy1vJIEUj-b8%el*o|VkG)LqNx#TG>Jvj^jIte!!+RY z)T4j$7+PoF1AkRBf}R#^T=-q|PaK1$c<4UH)Hpq3$4WA|xtr!ZQLC=*vNE>O6E9kp+5X0eKB$6>C(lPwI@3#oY zhS_%x7e|j!$yG?ECXmh~EH~^OeuK}+sWoJse3Z3?ha3n`MM9KvA?uqpEnBg4Q46)7 zM$p%a$@l;+O}vfvx%XjH`}a{(-HHth9!JaUwV0*VqGR48^gWNYN<&~7x)y$e!X>e` zZ5!6KZoxbKuV9XUDI%#M1~IVh?pNSdeb~6@$y`v|yk=XK+fHxnDqnUK4&=QRNyIVf zYbDM*cI>~qIy*a7=z7uqkw@agd(<=y-Q7L!ty_23SGdXmahO<;N=wB+j;lNm%=OHC zy zU|>La6h%92y4IPufI$9>Xu!@y`TaNgtg&41@PwMwBdmSm7)xAWDLoqjZ==P2#*k7! z3o1)cVSI3KP_!?d8G^Lg0FtLXC~JYdxi|c%h~lXEixY=%VSFF@!*3&&9>(Rb|iK54Cx5;s~PY5iaV1het%w`dgQFBAJ;aFK zImQC}(|QaCFYUm1JVfzSc)ebv=)ObI)0jwJb``}Zj9J0n0Xgn*Zc(rFM9$xh_makZbm-at_v5^SW zM1y1SW@%+FuIy*WR)i3A2N_q;(YO`O!A|Ts^%z}9ZepCj3ytlw#x%N_fNrKKtPh`< z|1{UqF`4LxHaCQ79+E=uUXCOZ35jAMRz%R%0(P!0FMv=sk>Nr8%+OzY^c-M9@+fz=G`qa@v4sF5u-2289-#$**LWnyNNDwDf1( zkUiMnw|y$tn>pQP=Vn!#|17L^5AGrjtBkN$D@v)Z7LXc5EFhLB4<;7Wehh)CMqX|W zqsiZaO^benJ_hwa&V0ub$-_HUk**?g6fm9|!@kguU6*zhK)$qn-<3*kFrYPIaqR=V zUaUvk>@F_89b@tHs8R!*QKY;INJ<2_U+K6Ca3e9Gsl2{qY0%a7J?uICWgHuLfj+MB z=GkAN1&ifT#2u}B+2S#~$5jA(Qn^;H%CCmIae4AE-Dsng|Hl*Ov!z72k3ZnJs{pp| z+pW`DDueC#mEWOf=ucJ!dTL}hzOeiS-i?m2E;`EKz4<&Lu~NnW?peqVU^@<+T3KKu z{yrI%Qy-Z%HEvLUz}n^~m?7x`xuCtNR#L2En!T>dQtIKdS#V-Hzt3RtwTeYtmQ&dR z6qXZvac*oc@BUYEH%@Ylv_1&tSjkbzzU6*h1(3^C`;1z;g_SmOtclS?KWk2VYE zM*oS<=C483XckW?GN|1jfh3Ro(h - - - diff --git a/Source/Samples/Android/ES11/Resources/values/Strings.xml b/Source/Samples/Android/ES11/Resources/values/Strings.xml deleted file mode 100644 index d0881b21..00000000 --- a/Source/Samples/Android/ES11/Resources/values/Strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - ES11 - diff --git a/Source/Samples/iOS/ES11/AppDelegate.cs b/Source/Samples/iOS/ES11/AppDelegate.cs deleted file mode 100644 index 65c8732d..00000000 --- a/Source/Samples/iOS/ES11/AppDelegate.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Foundation; -using UIKit; - -namespace ES11 -{ - - // The UIApplicationDelegate for the application. This class is responsible for launching the - // User Interface of the application, as well as listening (and optionally responding) to - // application events from iOS. - [Register("AppDelegate")] - public partial class AppDelegate : UIApplicationDelegate - { - // class-level declarations - public override UIWindow Window - { - get; - set; - } - // This method is invoked when the application is about to move from active to inactive state. - // OpenGL applications should use this method to pause. - public override void OnResignActivation(UIApplication application) - { - } - // This method should be used to release shared resources and it should store the application state. - // If your application supports background exection this method is called instead of WillTerminate - // when the user quits. - public override void DidEnterBackground(UIApplication application) - { - } - // This method is called as part of the transiton from background to active state. - public override void WillEnterForeground(UIApplication application) - { - } - // This method is called when the application is about to terminate. Save data, if needed. - public override void WillTerminate(UIApplication application) - { - } - } -} diff --git a/Source/Samples/iOS/ES11/EAGLView.cs b/Source/Samples/iOS/ES11/EAGLView.cs deleted file mode 100644 index e4630b3b..00000000 --- a/Source/Samples/iOS/ES11/EAGLView.cs +++ /dev/null @@ -1,351 +0,0 @@ -using System; -using OpenTK; -using OpenTK.Graphics.ES20; -using GL1 = OpenTK.Graphics.ES11.GL; -using All1 = OpenTK.Graphics.ES11.All; -using OpenTK.Platform.iPhoneOS; -using Foundation; -using CoreAnimation; -using ObjCRuntime; -using OpenGLES; -using UIKit; - -namespace ES11 -{ - - [Register("EAGLView")] - public class EAGLView : iPhoneOSGameView - { - [Export("initWithCoder:")] - public EAGLView(NSCoder coder) : base(coder) - { - LayerRetainsBacking = true; - LayerColorFormat = EAGLColorFormat.RGBA8; - } - - [Export("layerClass")] - public static new Class GetLayerClass() - { - return iPhoneOSGameView.GetLayerClass(); - } - - protected override void ConfigureLayer(CAEAGLLayer eaglLayer) - { - eaglLayer.Opaque = true; - } - - protected override void CreateFrameBuffer() - { - try - { - ContextRenderingApi = EAGLRenderingAPI.OpenGLES2; - base.CreateFrameBuffer(); - } - catch (Exception e) - { - System.Diagnostics.Debug.Print(e.ToString()); - ContextRenderingApi = EAGLRenderingAPI.OpenGLES1; - base.CreateFrameBuffer(); - } - - if (ContextRenderingApi == EAGLRenderingAPI.OpenGLES2) - LoadShaders(); - } - - protected override void DestroyFrameBuffer() - { - base.DestroyFrameBuffer(); - DestroyShaders(); - } - - #region DisplayLink support - - int frameInterval; - CADisplayLink displayLink; - - public bool IsAnimating { get; private set; } - // How many display frames must pass between each time the display link fires. - public int FrameInterval - { - get - { - return frameInterval; - } - set - { - if (value <= 0) - throw new ArgumentException(); - frameInterval = value; - if (IsAnimating) - { - StopAnimating(); - StartAnimating(); - } - } - } - - public void StartAnimating() - { - if (IsAnimating) - return; - - CreateFrameBuffer(); - displayLink = UIScreen.MainScreen.CreateDisplayLink(this, new Selector("drawFrame")); - displayLink.FrameInterval = frameInterval; - displayLink.AddToRunLoop(NSRunLoop.Current, NSRunLoop.NSDefaultRunLoopMode); - - IsAnimating = true; - } - - public void StopAnimating() - { - if (!IsAnimating) - return; - - displayLink.Invalidate(); - displayLink = null; - DestroyFrameBuffer(); - IsAnimating = false; - } - - [Export("drawFrame")] - void DrawFrame() - { - OnRenderFrame(new FrameEventArgs()); - } - - #endregion - - static readonly float[] squareVertices = - { - -0.5f, -0.33f, - 0.5f, -0.33f, - -0.5f, 0.33f, - 0.5f, 0.33f, - }; - static readonly byte[] squareColors = - { - 255, 255, 0, 255, - 0, 255, 255, 255, - 0, 0, 0, 0, - 255, 0, 255, 255, - }; - static float transY = 0.0f; - const int UNIFORM_TRANSLATE = 0; - const int UNIFORM_COUNT = 1; - readonly int[] uniforms = new int [UNIFORM_COUNT]; - const int ATTRIB_VERTEX = 0; - const int ATTRIB_COLOR = 1; - const int ATTRIB_COUNT = 2; - int program; - - protected override void OnRenderFrame(FrameEventArgs e) - { - base.OnRenderFrame(e); - - MakeCurrent(); - - // Replace the implementation of this method to do your own custom drawing. - GL.ClearColor(0.5f, 0.5f, 0.5f, 1.0f); - GL.Clear(ClearBufferMask.ColorBufferBit); - - if (ContextRenderingApi == EAGLRenderingAPI.OpenGLES2) - { - // Use shader program. - GL.UseProgram(program); - - // Update uniform value. - GL.Uniform1(uniforms[UNIFORM_TRANSLATE], transY); - transY += 0.075f; - - // Update attribute values. - GL.VertexAttribPointer(ATTRIB_VERTEX, 2, VertexAttribPointerType.Float, false, 0, squareVertices); - GL.EnableVertexAttribArray(ATTRIB_VERTEX); - GL.VertexAttribPointer(ATTRIB_COLOR, 4, VertexAttribPointerType.UnsignedByte, true, 0, squareColors); - GL.EnableVertexAttribArray(ATTRIB_COLOR); - - // Validate program before drawing. This is a good check, but only really necessary in a debug build. -#if DEBUG - if (!ValidateProgram (program)) { - Console.WriteLine ("Failed to validate program {0:x}", program); - return; - } -#endif - } - else - { - GL1.MatrixMode(All1.Projection); - GL1.LoadIdentity(); - GL1.MatrixMode(All1.Modelview); - GL1.LoadIdentity(); - GL1.Translate(0.0f, (float)Math.Sin(transY) / 2.0f, 0.0f); - transY += 0.075f; - - GL1.VertexPointer(2, All1.Float, 0, squareVertices); - GL1.EnableClientState(All1.VertexArray); - GL1.ColorPointer(4, All1.UnsignedByte, 0, squareColors); - GL1.EnableClientState(All1.ColorArray); - } - - GL.DrawArrays(BeginMode.TriangleStrip, 0, 4); - - SwapBuffers(); - } - - bool LoadShaders() - { - int vertShader, fragShader; - - // Create shader program. - program = GL.CreateProgram(); - - // Create and compile vertex shader. - var vertShaderPathname = NSBundle.MainBundle.PathForResource("Shader", "vsh"); - if (!CompileShader(ShaderType.VertexShader, vertShaderPathname, out vertShader)) - { - Console.WriteLine("Failed to compile vertex shader"); - return false; - } - - // Create and compile fragment shader. - var fragShaderPathname = NSBundle.MainBundle.PathForResource("Shader", "fsh"); - if (!CompileShader(ShaderType.FragmentShader, fragShaderPathname, out fragShader)) - { - Console.WriteLine("Failed to compile fragment shader"); - return false; - } - - // Attach vertex shader to program. - GL.AttachShader(program, vertShader); - - // Attach fragment shader to program. - GL.AttachShader(program, fragShader); - - // Bind attribute locations. - // This needs to be done prior to linking. - GL.BindAttribLocation(program, ATTRIB_VERTEX, "position"); - GL.BindAttribLocation(program, ATTRIB_COLOR, "color"); - - // Link program. - if (!LinkProgram(program)) - { - Console.WriteLine("Failed to link program: {0:x}", program); - - if (vertShader != 0) - GL.DeleteShader(vertShader); - - if (fragShader != 0) - GL.DeleteShader(fragShader); - - if (program != 0) - { - GL.DeleteProgram(program); - program = 0; - } - - return false; - } - - // Get uniform locations. - uniforms[UNIFORM_TRANSLATE] = GL.GetUniformLocation(program, "translate"); - - // Release vertex and fragment shaders. - if (vertShader != 0) - { - GL.DetachShader(program, vertShader); - GL.DeleteShader(vertShader); - } - - if (fragShader != 0) - { - GL.DetachShader(program, fragShader); - GL.DeleteShader(fragShader); - } - - return true; - } - - void DestroyShaders() - { - if (program != 0) - { - GL.DeleteProgram(program); - program = 0; - } - } - - #region Shader utilities - - static bool CompileShader(ShaderType type, string file, out int shader) - { - string src = System.IO.File.ReadAllText(file); - - shader = GL.CreateShader(type); - GL.ShaderSource(shader, 1, new string[] { src }, (int[])null); - GL.CompileShader(shader); - -#if DEBUG - int logLength; - GL.GetShader (shader, ShaderParameter.InfoLogLength, out logLength); - if (logLength > 0) { - var infoLog = new System.Text.StringBuilder (); - GL.GetShaderInfoLog (shader, logLength, out logLength, infoLog); - Console.WriteLine ("Shader compile log:\n{0}", infoLog); - } -#endif - int status; - GL.GetShader(shader, ShaderParameter.CompileStatus, out status); - if (status == 0) - { - GL.DeleteShader(shader); - return false; - } - - return true; - } - - static bool LinkProgram(int program) - { - GL.LinkProgram(program); - -#if DEBUG - int logLength; - GL.GetProgram (program, ProgramParameter.InfoLogLength, out logLength); - if (logLength > 0) { - var infoLog = new System.Text.StringBuilder (); - GL.GetProgramInfoLog (program, logLength, out logLength, infoLog); - Console.WriteLine ("Program link log:\n{0}", infoLog); - } -#endif - int status; - GL.GetProgram(program, ProgramParameter.LinkStatus, out status); - if (status == 0) - return false; - - return true; - } - - static bool ValidateProgram(int program) - { - GL.ValidateProgram(program); - - int logLength; - GL.GetProgram(program, ProgramParameter.InfoLogLength, out logLength); - if (logLength > 0) - { - var infoLog = new System.Text.StringBuilder(); - GL.GetProgramInfoLog(program, logLength, out logLength, infoLog); - Console.WriteLine("Program validate log:\n{0}", infoLog); - } - - int status; - GL.GetProgram(program, ProgramParameter.LinkStatus, out status); - if (status == 0) - return false; - - return true; - } - - #endregion - } -} diff --git a/Source/Samples/iOS/ES11/ES11.csproj b/Source/Samples/iOS/ES11/ES11.csproj deleted file mode 100644 index a33654aa..00000000 --- a/Source/Samples/iOS/ES11/ES11.csproj +++ /dev/null @@ -1,126 +0,0 @@ - - - - Debug - iPhoneSimulator - {7848ED9E-A937-4FDA-96DC-3B5B0EA27C59} - {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Exe - ES11 - Resources - ES11 - - - true - full - false - bin\iPhoneSimulator\Debug - DEBUG;__MOBILE__;__IOS__; - prompt - 4 - false - None - Entitlements.plist - true - - - full - true - bin\iPhoneSimulator\Release - __MOBILE__;__IOS__; - prompt - 4 - Full - false - Entitlements.plist - - - ARMv7 - - - true - full - false - bin\iPhone\Debug - DEBUG;__MOBILE__;__IOS__; - prompt - 4 - false - Entitlements.plist - true - iPhone Developer - - - - - ARMv7 - - - full - true - bin\iPhone\Release - __MOBILE__;__IOS__; - prompt - 4 - Entitlements.plist - false - iPhone Developer - - - full - true - bin\iPhone\Ad-Hoc - __MOBILE__;__IOS__; - prompt - 4 - false - Entitlements.plist - true - Automatic:AdHoc - iPhone Distribution - - - full - true - bin\iPhone\AppStore - __MOBILE__;__IOS__; - prompt - 4 - false - Entitlements.plist - Automatic:AppStore - iPhone Distribution - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {88368190-E3DF-4EBE-ACAA-7B1779F376CA} - OpenTK.iOS - - - - \ No newline at end of file diff --git a/Source/Samples/iOS/ES11/Entitlements.plist b/Source/Samples/iOS/ES11/Entitlements.plist deleted file mode 100644 index 9ae59937..00000000 --- a/Source/Samples/iOS/ES11/Entitlements.plist +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/Source/Samples/iOS/ES11/Info.plist b/Source/Samples/iOS/ES11/Info.plist deleted file mode 100644 index f0434871..00000000 --- a/Source/Samples/iOS/ES11/Info.plist +++ /dev/null @@ -1,44 +0,0 @@ - - - - - CFBundleDisplayName - ES11 - CFBundleIdentifier - com.your-company.ES11 - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - MinimumOSVersion - 7.0 - UIDeviceFamily - - 1 - 2 - - UIMainStoryboardFile - MainStoryboard_iPhone - UIMainStoryboardFile~ipad - MainStoryboard_iPad - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/Source/Samples/iOS/ES11/Main.cs b/Source/Samples/iOS/ES11/Main.cs deleted file mode 100644 index 30b24123..00000000 --- a/Source/Samples/iOS/ES11/Main.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Foundation; -using UIKit; - -namespace ES11 -{ - - public class Application - { - // This is the main entry point of the application. - static void Main(string[] args) - { - // if you want to use a different Application Delegate class from "AppDelegate" - // you can specify it here. - UIApplication.Main(args, null, "AppDelegate"); - } - } -} diff --git a/Source/Samples/iOS/ES11/MainStoryboard_iPad.storyboard b/Source/Samples/iOS/ES11/MainStoryboard_iPad.storyboard deleted file mode 100644 index 6c4c2918..00000000 --- a/Source/Samples/iOS/ES11/MainStoryboard_iPad.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/Samples/iOS/ES11/MainStoryboard_iPhone.storyboard b/Source/Samples/iOS/ES11/MainStoryboard_iPhone.storyboard deleted file mode 100644 index 3217beae..00000000 --- a/Source/Samples/iOS/ES11/MainStoryboard_iPhone.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/Samples/iOS/ES11/OpenGLViewController.cs b/Source/Samples/iOS/ES11/OpenGLViewController.cs deleted file mode 100644 index 27cea468..00000000 --- a/Source/Samples/iOS/ES11/OpenGLViewController.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using OpenTK; -using OpenTK.Graphics.ES20; -using OpenTK.Platform.iPhoneOS; -using Foundation; -using CoreAnimation; -using ObjCRuntime; -using OpenGLES; -using UIKit; - -namespace ES11 -{ - - [Register("OpenGLViewController")] - public partial class OpenGLViewController : UIViewController - { - public OpenGLViewController(IntPtr handle) : base(handle) - { - } - - new EAGLView View { get { return (EAGLView)base.View; } } - - public override void ViewDidLoad() - { - base.ViewDidLoad(); - - NSNotificationCenter.DefaultCenter.AddObserver(UIApplication.WillResignActiveNotification, a => - { - if (IsViewLoaded && View.Window != null) - View.StopAnimating(); - }, this); - NSNotificationCenter.DefaultCenter.AddObserver(UIApplication.DidBecomeActiveNotification, a => - { - if (IsViewLoaded && View.Window != null) - View.StartAnimating(); - }, this); - NSNotificationCenter.DefaultCenter.AddObserver(UIApplication.WillTerminateNotification, a => - { - if (IsViewLoaded && View.Window != null) - View.StopAnimating(); - }, this); - } - - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - - NSNotificationCenter.DefaultCenter.RemoveObserver(this); - } - - public override void DidReceiveMemoryWarning() - { - // Releases the view if it doesn't have a superview. - base.DidReceiveMemoryWarning(); - - // Release any cached data, images, etc that aren't in use. - } - - public override void ViewWillAppear(bool animated) - { - base.ViewWillAppear(animated); - View.StartAnimating(); - } - - public override void ViewWillDisappear(bool animated) - { - base.ViewWillDisappear(animated); - View.StopAnimating(); - } - } -} diff --git a/Source/Samples/iOS/ES11/Resources/Default-568h@2x.png b/Source/Samples/iOS/ES11/Resources/Default-568h@2x.png deleted file mode 100644 index 29973dcbed50cb67f5f522d4fd9cb5caddda6cc4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2215 zcmeAS@N?(olHy`uVBq!ia0y~yU}|7sU@72W0*ZWnTNDnYI14-?iy0WWg+Z8+Vb&Z8 z1_q8uPZ!6Kid%0F8ZrWv99r$Ma}qo=E%%Q~loCIFNg8Dsze diff --git a/Source/Samples/iOS/ES11/Shader.fsh b/Source/Samples/iOS/ES11/Shader.fsh deleted file mode 100644 index be11751c..00000000 --- a/Source/Samples/iOS/ES11/Shader.fsh +++ /dev/null @@ -1,6 +0,0 @@ -varying lowp vec4 colorVarying; - -void main() -{ - gl_FragColor = colorVarying; -} diff --git a/Source/Samples/iOS/ES11/Shader.vsh b/Source/Samples/iOS/ES11/Shader.vsh deleted file mode 100644 index c542f9b1..00000000 --- a/Source/Samples/iOS/ES11/Shader.vsh +++ /dev/null @@ -1,14 +0,0 @@ -attribute vec4 position; -attribute vec4 color; - -varying vec4 colorVarying; - -uniform float translate; - -void main() -{ - gl_Position = position; - gl_Position.y += sin(translate) / 2.0; - - colorVarying = color; -}