diff --git a/Source/Bind/CSharpSpecWriter.cs b/Source/Bind/CSharpSpecWriter.cs index 248c6c69..d347f545 100644 --- a/Source/Bind/CSharpSpecWriter.cs +++ b/Source/Bind/CSharpSpecWriter.cs @@ -505,6 +505,10 @@ namespace Bind sw.WriteLine("/// "); } + if (@enum.IsObsolete) + sw.WriteLine("[Obsolete(\"{0}\")]", @enum.Obsolete); + if (!@enum.CLSCompliant) + sw.WriteLine("[CLSCompliant(false)]"); if (@enum.IsFlagCollection) sw.WriteLine("[Flags]"); sw.WriteLine("public enum " + @enum.Name + " : " + @enum.Type); diff --git a/Source/Bind/EnumProcessor.cs b/Source/Bind/EnumProcessor.cs index 1e1a1714..9b9fc503 100644 --- a/Source/Bind/EnumProcessor.cs +++ b/Source/Bind/EnumProcessor.cs @@ -98,6 +98,25 @@ namespace Bind e.Name = name; processed_enums.Add(e.Name, e); } + + // Mark enums differing only in case as not CLS-compliant. + var list = enums.Values.ToList(); + while (list.Count > 0) + { + var e1 = list.Last(); + list.RemoveAt(list.Count - 1); + + var e2 = list.FirstOrDefault(l => String.Compare(e1.Name, l.Name, true) == 0); + if (e2 != null) + { + e1.CLSCompliant = false; + e2.CLSCompliant = false; + } + } + foreach (var e in enums.Values) + { + } + return processed_enums; } diff --git a/Source/Bind/Specifications/GL2/overrides.xml b/Source/Bind/Specifications/GL2/overrides.xml index 1d956a18..6292038f 100644 --- a/Source/Bind/Specifications/GL2/overrides.xml +++ b/Source/Bind/Specifications/GL2/overrides.xml @@ -4936,12 +4936,12 @@ - + - + @@ -4961,29 +4961,29 @@ - + - + - + - + - + @@ -4993,7 +4993,7 @@ - + @@ -5003,39 +5003,39 @@ - + - + - + - + - + - + - + @@ -5048,35 +5048,35 @@ - + - + - + - + - + - + - + - + - + @@ -5112,20 +5112,20 @@ - + - + - + @@ -5144,13 +5144,13 @@ - + - + @@ -5158,45 +5158,45 @@ - + - + - + - + - + - + - + - + - + - + @@ -5212,27 +5212,27 @@ - + - + - + - + - + - + diff --git a/Source/Bind/Structures/Delegate.cs b/Source/Bind/Structures/Delegate.cs index 5c072d1e..61f290b9 100644 --- a/Source/Bind/Structures/Delegate.cs +++ b/Source/Bind/Structures/Delegate.cs @@ -53,7 +53,7 @@ namespace Bind.Structures DeprecatedVersion = d.DeprecatedVersion; EntryPoint = d.EntryPoint; Obsolete = d.Obsolete; - CLSCompliant = d.CLSCompliant; + cls_compliance_overriden = d.cls_compliance_overriden; Slot = d.Slot; } diff --git a/Source/Bind/Structures/Enum.cs b/Source/Bind/Structures/Enum.cs index 0c105ec8..85c79cea 100644 --- a/Source/Bind/Structures/Enum.cs +++ b/Source/Bind/Structures/Enum.cs @@ -19,6 +19,11 @@ namespace Bind.Structures { string _name, _type; + public Enum() + { + CLSCompliant = true; + } + // Returns true if the enum contains a collection of flags, i.e. 1, 2, 4, 8, ... public bool IsFlagCollection { @@ -69,6 +74,11 @@ namespace Bind.Structures { ConstantCollection.Add(constant.Name, constant); } + + public string Obsolete { get; set; } + public bool IsObsolete { get { return !String.IsNullOrEmpty(Obsolete); } } + + public bool CLSCompliant { get; set; } } #endregion diff --git a/Source/Bind/XmlSpecReader.cs b/Source/Bind/XmlSpecReader.cs index e98e8f34..6bb8a175 100644 --- a/Source/Bind/XmlSpecReader.cs +++ b/Source/Bind/XmlSpecReader.cs @@ -353,6 +353,8 @@ namespace Bind Type = node.GetAttribute("type", String.Empty).Trim() }; + e.Obsolete = node.GetAttribute("obsolete", String.Empty).Trim(); + if (String.IsNullOrEmpty(e.Name)) throw new InvalidOperationException(String.Format("Empty name for enum element {0}", node.ToString())); diff --git a/Source/Compatibility/OpenTK.Compatibility.csproj b/Source/Compatibility/OpenTK.Compatibility.csproj index ea5c6614..2bd5ca0c 100644 --- a/Source/Compatibility/OpenTK.Compatibility.csproj +++ b/Source/Compatibility/OpenTK.Compatibility.csproj @@ -471,7 +471,7 @@ OpenTK.snk - Always + PreserveNewest diff --git a/Source/Compatibility/Tao/OpenGl/Glu.cs b/Source/Compatibility/Tao/OpenGl/Glu.cs index 5ea08291..0ec0573a 100644 --- a/Source/Compatibility/Tao/OpenGl/Glu.cs +++ b/Source/Compatibility/Tao/OpenGl/Glu.cs @@ -29,6 +29,8 @@ using System; using System.Runtime.InteropServices; using System.Security; +#pragma warning disable 169 // private field is never used + namespace Tao.OpenGl { #region Class Documentation diff --git a/Source/Converter/ESCLParser.cs b/Source/Converter/ESCLParser.cs index 8548f7d5..e8e2ddc6 100644 --- a/Source/Converter/ESCLParser.cs +++ b/Source/Converter/ESCLParser.cs @@ -198,10 +198,6 @@ namespace CHeaderToXML var parameters_string = Regex.Match(line, @"\(.*\)").Captures[0].Value.TrimStart('(').TrimEnd(')'); - var parameters = - (from item in get_param.Matches(parameters_string).OfType() - select item.Captures[0].Value.TrimEnd(',')).ToList(); - var fun = new { diff --git a/Source/Converter/GLXmlParser.cs b/Source/Converter/GLXmlParser.cs index f40b3d8e..28596c32 100644 --- a/Source/Converter/GLXmlParser.cs +++ b/Source/Converter/GLXmlParser.cs @@ -146,8 +146,6 @@ namespace CHeaderToXML .Concat(groups) .OrderBy(f => TrimName(f.Attribute("name").Value))) { - var category = TrimName(feature.Attribute("name").Value); - var extension = feature.Name == "extension" ? category.Substring(0, category.IndexOf("_")) : "Core"; var version = feature.Attribute("number") != null ? feature.Attribute("number").Value : null; var apinames = GetApiNames(feature); diff --git a/Source/Examples/OpenAL/1.1/Playback.cs b/Source/Examples/OpenAL/1.1/Playback.cs index dbf995ab..ea9a1913 100644 --- a/Source/Examples/OpenAL/1.1/Playback.cs +++ b/Source/Examples/OpenAL/1.1/Playback.cs @@ -10,6 +10,8 @@ using System.IO; using OpenTK.Audio; using OpenTK.Audio.OpenAL; +#pragma warning disable 219 // variable assigned but never used, we do that on purpose + namespace Examples { [Example("Playback", ExampleCategory.OpenAL, "1.1", Documentation="Playback")] diff --git a/Source/Examples/OpenAL/Test/OpenALDiagnostics.cs b/Source/Examples/OpenAL/Test/OpenALDiagnostics.cs index eea09148..bf2d0613 100644 --- a/Source/Examples/OpenAL/Test/OpenALDiagnostics.cs +++ b/Source/Examples/OpenAL/Test/OpenALDiagnostics.cs @@ -453,7 +453,7 @@ namespace Examples foreach (XRamExtension.XRamStorage m in storagemodes) { - bool result = XRam.SetBufferMode(1, ref buffer, m); + XRam.SetBufferMode(1, ref buffer, m); BufferModes.Add(m.ToString(), m == XRam.GetBufferMode(ref buffer)); } diff --git a/Source/Examples/OpenGL/1.x/Anaglyph.cs b/Source/Examples/OpenGL/1.x/Anaglyph.cs index 35ce7a1b..861742d7 100644 --- a/Source/Examples/OpenGL/1.x/Anaglyph.cs +++ b/Source/Examples/OpenGL/1.x/Anaglyph.cs @@ -72,7 +72,8 @@ namespace Examples.Tutorial { base.OnUpdateFrame(e); - if (Keyboard[Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[Key.Escape]) Exit(); } diff --git a/Source/Examples/OpenGL/1.x/DisplayLists.cs b/Source/Examples/OpenGL/1.x/DisplayLists.cs index 034929e2..62974090 100644 --- a/Source/Examples/OpenGL/1.x/DisplayLists.cs +++ b/Source/Examples/OpenGL/1.x/DisplayLists.cs @@ -112,7 +112,8 @@ namespace Examples.Tutorial protected override void OnUpdateFrame(FrameEventArgs e) { - if (Keyboard[OpenTK.Input.Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[OpenTK.Input.Key.Escape]) { this.Exit(); } diff --git a/Source/Examples/OpenGL/1.x/FramebufferObject.cs b/Source/Examples/OpenGL/1.x/FramebufferObject.cs index 0847a9a0..743fd790 100644 --- a/Source/Examples/OpenGL/1.x/FramebufferObject.cs +++ b/Source/Examples/OpenGL/1.x/FramebufferObject.cs @@ -21,8 +21,6 @@ namespace Examples.Tutorial { } - Font sans = new Font(System.Drawing.FontFamily.GenericSansSerif, 16.0f); - uint ColorTexture; uint DepthTexture; uint FBOHandle; @@ -220,7 +218,8 @@ namespace Examples.Tutorial { base.OnUpdateFrame(e); - if (Keyboard[Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[Key.Escape]) this.Exit(); } diff --git a/Source/Examples/OpenGL/1.x/ImmediateMode.cs b/Source/Examples/OpenGL/1.x/ImmediateMode.cs index 166ff6ef..76d8e9f8 100644 --- a/Source/Examples/OpenGL/1.x/ImmediateMode.cs +++ b/Source/Examples/OpenGL/1.x/ImmediateMode.cs @@ -88,7 +88,8 @@ namespace Examples.Tutorial { base.OnUpdateFrame(e); - if (Keyboard[OpenTK.Input.Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[OpenTK.Input.Key.Escape]) { this.Exit(); return; diff --git a/Source/Examples/OpenGL/1.x/OpenGLDiagnostics.cs b/Source/Examples/OpenGL/1.x/OpenGLDiagnostics.cs index 48857643..ea3a45b3 100644 --- a/Source/Examples/OpenGL/1.x/OpenGLDiagnostics.cs +++ b/Source/Examples/OpenGL/1.x/OpenGLDiagnostics.cs @@ -411,7 +411,8 @@ namespace Examples.Tutorial { base.OnUpdateFrame(e); - if (Keyboard[Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[Key.Escape]) Exit(); } diff --git a/Source/Examples/OpenGL/1.x/Picking.cs b/Source/Examples/OpenGL/1.x/Picking.cs index 67c8323b..deb28812 100644 --- a/Source/Examples/OpenGL/1.x/Picking.cs +++ b/Source/Examples/OpenGL/1.x/Picking.cs @@ -24,11 +24,19 @@ namespace Examples.Tutorial [Example("Picking", ExampleCategory.OpenGL, "1.x", Documentation = "Picking")] class Picking : GameWindow { + int mouse_x, mouse_y; + /// Creates a 800x600 window with the specified title. public Picking() : base(800, 600, GraphicsMode.Default, "Picking", GameWindowFlags.Default, DisplayDevice.Default, 1, 1, GraphicsContextFlags.Default) { VSync = VSyncMode.On; + + MouseMove += (sender, e) => + { + mouse_x = e.X; + mouse_y = e.Y; + }; } struct Byte4 @@ -192,7 +200,6 @@ namespace Examples.Tutorial GL.UseProgram(0); */ #endregion Shader - } protected override void OnUnload(EventArgs e) @@ -224,7 +231,8 @@ namespace Examples.Tutorial /// Contains timing information for framerate independent logic. protected override void OnUpdateFrame(FrameEventArgs e) { - if (Keyboard[Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[Key.Escape]) Exit(); } @@ -256,7 +264,7 @@ namespace Examples.Tutorial // Read Pixel under mouse cursor Byte4 Pixel = new Byte4(); - GL.ReadPixels(Mouse.X, this.Height - Mouse.Y, 1, 1, PixelFormat.Rgba, PixelType.UnsignedByte, ref Pixel); + GL.ReadPixels(mouse_x, this.Height - mouse_y, 1, 1, PixelFormat.Rgba, PixelType.UnsignedByte, ref Pixel); SelectedTriangle = Pixel.ToUInt32(); #endregion Pass 1: Draw Object and pick Triangle diff --git a/Source/Examples/OpenGL/1.x/StencilCSG.cs b/Source/Examples/OpenGL/1.x/StencilCSG.cs index 116fcf03..242be0d7 100644 --- a/Source/Examples/OpenGL/1.x/StencilCSG.cs +++ b/Source/Examples/OpenGL/1.x/StencilCSG.cs @@ -42,7 +42,7 @@ namespace Examples.Tutorial : base(800, 600, new GraphicsMode(new ColorFormat(8, 8, 8, 8), 24, 8)) // request 8-bit stencil buffer { base.VSync = VSyncMode.Off; - Keyboard.KeyDown += delegate(object sender, KeyboardKeyEventArgs e) + KeyDown += delegate(object sender, KeyboardKeyEventArgs e) { switch (e.Key) { @@ -174,11 +174,10 @@ namespace Examples.Tutorial protected override void OnUpdateFrame(FrameEventArgs e) { - #region Magic numbers for camera - CameraRotX = -Mouse.X * .5f; - CameraRotY = Mouse.Y * .5f; - CameraZoom = Mouse.Wheel * .2f; - #endregion Magic numbers for camera + var mouse = OpenTK.Input.Mouse.GetState(); + CameraRotX = -mouse.X * .5f; + CameraRotY = mouse.Y * .5f; + CameraZoom = mouse.Wheel * .2f; } public void DrawOperandB() diff --git a/Source/Examples/OpenGL/1.x/TextRendering.cs b/Source/Examples/OpenGL/1.x/TextRendering.cs index 9eb975f0..016ff54a 100644 --- a/Source/Examples/OpenGL/1.x/TextRendering.cs +++ b/Source/Examples/OpenGL/1.x/TextRendering.cs @@ -215,7 +215,8 @@ namespace Examples.Tutorial protected override void OnUpdateFrame(FrameEventArgs e) { - if (Keyboard[OpenTK.Input.Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[OpenTK.Input.Key.Escape]) { this.Exit(); } diff --git a/Source/Examples/OpenGL/1.x/TextureMatrix.cs b/Source/Examples/OpenGL/1.x/TextureMatrix.cs index 7f98ea12..6b5c6d11 100644 --- a/Source/Examples/OpenGL/1.x/TextureMatrix.cs +++ b/Source/Examples/OpenGL/1.x/TextureMatrix.cs @@ -18,6 +18,7 @@ namespace Examples.Tutorial class TextureMatrix : GameWindow { + Vector2 orientation; public TextureMatrix() : base(800, 600, new GraphicsMode(32, 16, 0, 4)) @@ -89,8 +90,12 @@ namespace Examples.Tutorial protected override void OnUpdateFrame(FrameEventArgs e) { - if (Keyboard[Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[Key.Escape]) Exit(); + + var mouse = OpenTK.Input.Mouse.GetState(); + orientation = new Vector2(mouse.X, mouse.Y); } protected override void OnRenderFrame(FrameEventArgs e) @@ -107,9 +112,10 @@ namespace Examples.Tutorial GL.Translate(0f, 0f, 1.5f); - GL.Rotate(Mouse.X, Vector3.UnitY); - GL.Rotate(Mouse.Y, Vector3.UnitX); + GL.Rotate(orientation.X, Vector3.UnitY); + GL.Rotate(orientation.Y, Vector3.UnitX); + GL.BindTexture(TextureTarget.Texture2D, Texture); GL.CallList(list); SwapBuffers(); diff --git a/Source/Examples/OpenGL/1.x/Textures.cs b/Source/Examples/OpenGL/1.x/Textures.cs index 4ad60814..edfc85c0 100644 --- a/Source/Examples/OpenGL/1.x/Textures.cs +++ b/Source/Examples/OpenGL/1.x/Textures.cs @@ -93,7 +93,8 @@ namespace Examples.Tutorial /// There is no need to call the base implementation. protected override void OnUpdateFrame(FrameEventArgs e) { - if (Keyboard[OpenTK.Input.Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[OpenTK.Input.Key.Escape]) this.Exit(); } diff --git a/Source/Examples/OpenGL/1.x/VBODynamic.cs b/Source/Examples/OpenGL/1.x/VBODynamic.cs index 16b012db..3b0fc0b0 100644 --- a/Source/Examples/OpenGL/1.x/VBODynamic.cs +++ b/Source/Examples/OpenGL/1.x/VBODynamic.cs @@ -136,7 +136,8 @@ namespace Examples.Tutorial /// Contains timing information for framerate independent logic. protected override void OnUpdateFrame(FrameEventArgs e) { - if (Keyboard[Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[Key.Escape]) { Exit(); } diff --git a/Source/Examples/OpenGL/1.x/VBOStatic.cs b/Source/Examples/OpenGL/1.x/VBOStatic.cs index 0c43a81d..0ae2ea0b 100644 --- a/Source/Examples/OpenGL/1.x/VBOStatic.cs +++ b/Source/Examples/OpenGL/1.x/VBOStatic.cs @@ -88,7 +88,8 @@ namespace Examples.Tutorial { base.OnUpdateFrame(e); - if (Keyboard[OpenTK.Input.Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[OpenTK.Input.Key.Escape]) this.Exit(); } diff --git a/Source/Examples/OpenGL/1.x/VertexArrays.cs b/Source/Examples/OpenGL/1.x/VertexArrays.cs index 6f50602e..4fe29c88 100644 --- a/Source/Examples/OpenGL/1.x/VertexArrays.cs +++ b/Source/Examples/OpenGL/1.x/VertexArrays.cs @@ -36,7 +36,7 @@ namespace Examples.Tutorial : base(800, 600) { //this.VSync = VSyncMode.On; - this.Keyboard.KeyUp += Keyboard_KeyUp; + KeyUp += Keyboard_KeyUp; } void Keyboard_KeyUp(object sender, KeyboardKeyEventArgs e) @@ -107,14 +107,15 @@ namespace Examples.Tutorial /// protected override void OnUpdateFrame(FrameEventArgs e) { - // Escape quits. - if (Keyboard[Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + + if (keyboard[Key.Escape]) { this.Exit(); return; } - if (Keyboard[Key.F11]) + if (keyboard[Key.F11]) if (WindowState != WindowState.Fullscreen) WindowState = WindowState.Fullscreen; else @@ -122,14 +123,14 @@ namespace Examples.Tutorial // Plus/Minus change the target render frequency. // PageUp/PageDown change the target update frequency. - if (Keyboard[Key.Plus] || Keyboard[Key.KeypadAdd]) TargetRenderFrequency++; - if (Keyboard[Key.Minus] || Keyboard[Key.KeypadSubtract]) TargetRenderFrequency--; - if (Keyboard[Key.PageUp]) TargetUpdateFrequency++; - if (Keyboard[Key.PageDown]) TargetUpdateFrequency--; + if (keyboard[Key.Plus] || keyboard[Key.KeypadAdd]) TargetRenderFrequency++; + if (keyboard[Key.Minus] || keyboard[Key.KeypadSubtract]) TargetRenderFrequency--; + if (keyboard[Key.PageUp]) TargetUpdateFrequency++; + if (keyboard[Key.PageDown]) TargetUpdateFrequency--; // Right/Left control the rotation speed and direction. - if (Keyboard[Key.Right]) rotation_speed += 0.5f; - if (Keyboard[Key.Left]) rotation_speed -= 0.5f; + if (keyboard[Key.Right]) rotation_speed += 0.5f; + if (keyboard[Key.Left]) rotation_speed -= 0.5f; } #endregion diff --git a/Source/Examples/OpenGL/1.x/VertexLighting.cs b/Source/Examples/OpenGL/1.x/VertexLighting.cs index fb950f23..2b31bc94 100644 --- a/Source/Examples/OpenGL/1.x/VertexLighting.cs +++ b/Source/Examples/OpenGL/1.x/VertexLighting.cs @@ -100,24 +100,27 @@ namespace Examples.Tutorial /// protected override void OnUpdateFrame(FrameEventArgs e) { - if (Keyboard[OpenTK.Input.Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + var mouse = OpenTK.Input.Mouse.GetState(); + + if (keyboard[OpenTK.Input.Key.Escape]) { this.Exit(); return; } - if (Keyboard[OpenTK.Input.Key.F11]) + if (keyboard[OpenTK.Input.Key.F11]) if (WindowState != WindowState.Fullscreen) WindowState = WindowState.Fullscreen; else WindowState = WindowState.Normal; - if (Mouse[OpenTK.Input.MouseButton.Left]) - x_angle = Mouse.X; + if (mouse[OpenTK.Input.MouseButton.Left]) + x_angle = mouse.X; else x_angle += 0.5f; - zoom = Mouse.Wheel * 0.5f; // Mouse.Wheel is broken on both Linux and Windows. + zoom = mouse.Wheel * 0.5f; // Mouse.Wheel is broken on both Linux and Windows. // Do not leave x_angle drift too far away, as this will cause inaccuracies. if (x_angle > 360.0f) diff --git a/Source/Examples/OpenGL/2.x/DDSCubeMap.cs b/Source/Examples/OpenGL/2.x/DDSCubeMap.cs index 3e152fdf..d8334bc9 100644 --- a/Source/Examples/OpenGL/2.x/DDSCubeMap.cs +++ b/Source/Examples/OpenGL/2.x/DDSCubeMap.cs @@ -198,19 +198,21 @@ namespace Examples.Tutorial /// Add your game logic here. /// Contains timing information. /// There is no need to call the base implementation. - protected override void OnUpdateFrame( FrameEventArgs e ) + protected override void OnUpdateFrame(FrameEventArgs e) { - base.OnUpdateFrame( e ); + base.OnUpdateFrame(e); - if ( Keyboard[OpenTK.Input.Key.Escape] ) - this.Exit( ); - if ( Keyboard[OpenTK.Input.Key.Space] ) - Trace.WriteLine( "GL: " + GL.GetError( ) ); + var keyboard = OpenTK.Input.Keyboard.GetState(); + var mouse = OpenTK.Input.Mouse.GetState(); - Trackball.X = Mouse.X; - Trackball.Y = Mouse.Y; - Trackball.Z = Mouse.Wheel * 0.5f; + if (keyboard[OpenTK.Input.Key.Escape]) + this.Exit(); + if (keyboard[OpenTK.Input.Key.Space]) + Trace.WriteLine("GL: " + GL.GetError()); + Trackball.X = mouse.X; + Trackball.Y = mouse.Y; + Trackball.Z = mouse.Scroll.Y * 0.5f; } /// Add your game rendering code here. diff --git a/Source/Examples/OpenGL/2.x/GeometryShader.cs b/Source/Examples/OpenGL/2.x/GeometryShader.cs index 26b9d4c7..74b625d6 100644 --- a/Source/Examples/OpenGL/2.x/GeometryShader.cs +++ b/Source/Examples/OpenGL/2.x/GeometryShader.cs @@ -195,14 +195,15 @@ namespace Examples.Tutorial { base.OnUpdateFrame(e); - if (Keyboard[Key.Space]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[Key.Space]) { ErrorCode err = GL.GetError(); //Console.WriteLine(err + " " + Glu.ErrorString((GluErrorCode)err)); Console.WriteLine("GL error code: {0}", err); } - if (Keyboard[Key.Escape]) + if (keyboard[Key.Escape]) this.Exit(); } diff --git a/Source/Examples/OpenGL/2.x/GeometryShaderAdvanced.cs b/Source/Examples/OpenGL/2.x/GeometryShaderAdvanced.cs index 6d72e0ea..69d1f17f 100644 --- a/Source/Examples/OpenGL/2.x/GeometryShaderAdvanced.cs +++ b/Source/Examples/OpenGL/2.x/GeometryShaderAdvanced.cs @@ -46,7 +46,7 @@ namespace Examples.Tutorial public SimpleGeometryShader2() : base(800, 600) { - Keyboard.KeyDown += Keyboard_KeyDown; + KeyDown += Keyboard_KeyDown; } enum ViewMode @@ -83,7 +83,6 @@ namespace Examples.Tutorial int vboSphere; int vboSphereStride = BlittableValueType.Stride; int eboSphere; - int sphereElementCount; ViewMode mode = ViewMode.Scene; Vector3 eyePos = new Vector3(0, -8, 0); @@ -551,7 +550,6 @@ namespace Examples.Tutorial { VertexPositionNormalTexture[] sphereVertices = CalculateSphereVertices(1, 1, 16, 16); ushort[] sphereElements = CalculateSphereElements(1, 1, 16, 16); - sphereElementCount = sphereElements.Length; GL.GenBuffers(1, out vboSphere); GL.BindBuffer(BufferTarget.ArrayBuffer, vboSphere); @@ -900,7 +898,8 @@ namespace Examples.Tutorial eyePos.X = (float)Math.Cos(elapsed / 3000) * 8; eyePos.Z = (float)Math.Sin(elapsed / 2000) * 8; - if (Keyboard[Key.Space]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[Key.Space]) { ErrorCode err = GL.GetError(); //Console.WriteLine(err + " " + Glu.ErrorString((GluErrorCode)err)); diff --git a/Source/Examples/OpenGL/2.x/JuliaSetFractal.cs b/Source/Examples/OpenGL/2.x/JuliaSetFractal.cs index f9c88a20..c896c217 100644 --- a/Source/Examples/OpenGL/2.x/JuliaSetFractal.cs +++ b/Source/Examples/OpenGL/2.x/JuliaSetFractal.cs @@ -157,8 +157,8 @@ namespace Examples.Tutorial bitmap.UnlockBits(data); } #endregion Textures - - Keyboard.KeyUp += Keyboard_KeyUp; + + KeyUp += Keyboard_KeyUp; } int i = 0; @@ -233,7 +233,8 @@ namespace Examples.Tutorial { base.OnUpdateFrame(e); - if (Keyboard[OpenTK.Input.Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[OpenTK.Input.Key.Escape]) { this.Exit(); } diff --git a/Source/Examples/OpenGL/2.x/SimpleGLSL.cs b/Source/Examples/OpenGL/2.x/SimpleGLSL.cs index c2eac194..3835ff77 100644 --- a/Source/Examples/OpenGL/2.x/SimpleGLSL.cs +++ b/Source/Examples/OpenGL/2.x/SimpleGLSL.cs @@ -214,10 +214,11 @@ namespace Examples.Tutorial /// protected override void OnUpdateFrame(FrameEventArgs e) { - if (Keyboard[OpenTK.Input.Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[OpenTK.Input.Key.Escape]) this.Exit(); - if (Keyboard[OpenTK.Input.Key.F11]) + if (keyboard[OpenTK.Input.Key.F11]) if (WindowState != WindowState.Fullscreen) WindowState = WindowState.Fullscreen; else diff --git a/Source/Examples/OpenGL/2.x/SwizzledParallax.cs b/Source/Examples/OpenGL/2.x/SwizzledParallax.cs index 6e5bf4e5..09dd5d25 100644 --- a/Source/Examples/OpenGL/2.x/SwizzledParallax.cs +++ b/Source/Examples/OpenGL/2.x/SwizzledParallax.cs @@ -224,52 +224,62 @@ namespace Examples.Tutorial base.OnResize( e ); } + protected override void OnKeyDown(OpenTK.Input.KeyboardKeyEventArgs e) + { + base.OnKeyDown(e); + + if (e.Keyboard[OpenTK.Input.Key.Escape]) + this.Exit(); + if (e.Keyboard[OpenTK.Input.Key.Space]) + Trace.WriteLine("GL: " + GL.GetError()); + if (e.Keyboard[OpenTK.Input.Key.Q]) + { + MaterialScaleAndBiasAndShininess.X += 0.01f; + Trace.WriteLine("Scale: " + MaterialScaleAndBiasAndShininess.X + " Bias: " + MaterialScaleAndBiasAndShininess.Y); + } + if (e.Keyboard[OpenTK.Input.Key.A]) + { + MaterialScaleAndBiasAndShininess.X -= 0.01f; + Trace.WriteLine("Scale: " + MaterialScaleAndBiasAndShininess.X + " Bias: " + MaterialScaleAndBiasAndShininess.Y); + } + if (e.Keyboard[OpenTK.Input.Key.W]) + { + MaterialScaleAndBiasAndShininess.Y += 0.01f; + Trace.WriteLine("Scale: " + MaterialScaleAndBiasAndShininess.X + " Bias: " + MaterialScaleAndBiasAndShininess.Y); + } + if (e.Keyboard[OpenTK.Input.Key.S]) + { + MaterialScaleAndBiasAndShininess.Y -= 0.01f; + Trace.WriteLine("Scale: " + MaterialScaleAndBiasAndShininess.X + " Bias: " + MaterialScaleAndBiasAndShininess.Y); + } + if (e.Keyboard[OpenTK.Input.Key.E]) + { + MaterialScaleAndBiasAndShininess.Z += 1f; + Trace.WriteLine("Shininess: " + MaterialScaleAndBiasAndShininess.Z); + } + if (e.Keyboard[OpenTK.Input.Key.D]) + { + MaterialScaleAndBiasAndShininess.Z -= 1f; + Trace.WriteLine("Shininess: " + MaterialScaleAndBiasAndShininess.Z); + } + } + + protected override void OnMouseMove(OpenTK.Input.MouseMoveEventArgs e) + { + base.OnMouseMove(e); + + LightPosition.X = (-(this.Width / 2) + e.Mouse.X) / 100f; + LightPosition.Y = ((this.Height / 2) - e.Mouse.Y) / 100f; + + EyePos.Y = e.Mouse.Wheel * 0.5f; + } + /// Add your game logic here. /// Contains timing information. /// There is no need to call the base implementation. - protected override void OnUpdateFrame( FrameEventArgs e ) + protected override void OnUpdateFrame( FrameEventArgs e ) { base.OnUpdateFrame( e ); - - if ( Keyboard[OpenTK.Input.Key.Escape] ) - this.Exit( ); - if ( Keyboard[OpenTK.Input.Key.Space] ) - Trace.WriteLine( "GL: " + GL.GetError( ) ); - if ( Keyboard[OpenTK.Input.Key.Q] ) - { - MaterialScaleAndBiasAndShininess.X += 0.01f; - Trace.WriteLine( "Scale: " + MaterialScaleAndBiasAndShininess.X + " Bias: " + MaterialScaleAndBiasAndShininess.Y ); - } - if ( Keyboard[OpenTK.Input.Key.A] ) - { - MaterialScaleAndBiasAndShininess.X -= 0.01f; - Trace.WriteLine( "Scale: " + MaterialScaleAndBiasAndShininess.X + " Bias: " + MaterialScaleAndBiasAndShininess.Y ); - } - if ( Keyboard[OpenTK.Input.Key.W] ) - { - MaterialScaleAndBiasAndShininess.Y += 0.01f; - Trace.WriteLine( "Scale: " + MaterialScaleAndBiasAndShininess.X + " Bias: " + MaterialScaleAndBiasAndShininess.Y ); - } - if ( Keyboard[OpenTK.Input.Key.S] ) - { - MaterialScaleAndBiasAndShininess.Y -= 0.01f; - Trace.WriteLine( "Scale: " + MaterialScaleAndBiasAndShininess.X + " Bias: " + MaterialScaleAndBiasAndShininess.Y ); - } - if ( Keyboard[OpenTK.Input.Key.E] ) - { - MaterialScaleAndBiasAndShininess.Z += 1f; - Trace.WriteLine( "Shininess: " + MaterialScaleAndBiasAndShininess.Z ); - } - if ( Keyboard[OpenTK.Input.Key.D] ) - { - MaterialScaleAndBiasAndShininess.Z -= 1f; - Trace.WriteLine( "Shininess: " + MaterialScaleAndBiasAndShininess.Z ); - } - - LightPosition.X = ( -( this.Width / 2 ) + Mouse.X ) / 100f; - LightPosition.Y = ( ( this.Height / 2 ) - Mouse.Y ) / 100f; - - EyePos.Y = Mouse.Wheel * 0.5f; } /// Add your game rendering code here. diff --git a/Source/Examples/OpenGL/3.x/HelloGL3.cs b/Source/Examples/OpenGL/3.x/HelloGL3.cs index 81a64bf8..0a9877a1 100644 --- a/Source/Examples/OpenGL/3.x/HelloGL3.cs +++ b/Source/Examples/OpenGL/3.x/HelloGL3.cs @@ -202,7 +202,8 @@ void main(void) Matrix4.Mult(ref rotation, ref modelviewMatrix, out modelviewMatrix); GL.UniformMatrix4(modelviewMatrixLocation, false, ref modelviewMatrix); - if (Keyboard[OpenTK.Input.Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[OpenTK.Input.Key.Escape]) Exit(); } diff --git a/Source/Examples/OpenGLES/2.0/SimpleWindow20.cs b/Source/Examples/OpenGLES/2.0/SimpleWindow20.cs index ac01e84a..c1470705 100644 --- a/Source/Examples/OpenGLES/2.0/SimpleWindow20.cs +++ b/Source/Examples/OpenGLES/2.0/SimpleWindow20.cs @@ -69,7 +69,8 @@ namespace Examples.Tutorial /// protected override void OnUpdateFrame(FrameEventArgs e) { - if (Keyboard[OpenTK.Input.Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[OpenTK.Input.Key.Escape]) { this.Exit(); return; diff --git a/Source/Examples/OpenTK.Examples.csproj b/Source/Examples/OpenTK.Examples.csproj index 7928ff09..cca433b0 100644 --- a/Source/Examples/OpenTK.Examples.csproj +++ b/Source/Examples/OpenTK.Examples.csproj @@ -379,9 +379,6 @@ Code - - Form - @@ -476,12 +473,6 @@ Extensions.cs - - InputLogger.cs - - - InputLogger.cs - OpenTK.snk @@ -649,4 +640,4 @@ - + \ No newline at end of file diff --git a/Source/Examples/OpenTK/GameWindow/GameWindowMsaa.cs b/Source/Examples/OpenTK/GameWindow/GameWindowMsaa.cs index afecfcd7..38c4ae63 100644 --- a/Source/Examples/OpenTK/GameWindow/GameWindowMsaa.cs +++ b/Source/Examples/OpenTK/GameWindow/GameWindowMsaa.cs @@ -17,7 +17,7 @@ namespace Examples public FullscreenAntialias() : base(800, 600, new GraphicsMode(32, 0, 0, 4)) { - Keyboard.KeyDown += Keyboard_KeyDown; + KeyDown += Keyboard_KeyDown; } #region Keyboard_KeyDown diff --git a/Source/Examples/OpenTK/GameWindow/GameWindowSimple.cs b/Source/Examples/OpenTK/GameWindow/GameWindowSimple.cs index 383fdfad..697e9622 100644 --- a/Source/Examples/OpenTK/GameWindow/GameWindowSimple.cs +++ b/Source/Examples/OpenTK/GameWindow/GameWindowSimple.cs @@ -18,7 +18,7 @@ namespace Examples.Tutorial { public SimpleWindow() : base(800, 600) { - Keyboard.KeyDown += Keyboard_KeyDown; + KeyDown += Keyboard_KeyDown; } #region Keyboard_KeyDown diff --git a/Source/Examples/OpenTK/GameWindow/GameWindowThreaded.cs b/Source/Examples/OpenTK/GameWindow/GameWindowThreaded.cs index bcc7183d..c60f0afa 100644 --- a/Source/Examples/OpenTK/GameWindow/GameWindowThreaded.cs +++ b/Source/Examples/OpenTK/GameWindow/GameWindowThreaded.cs @@ -43,13 +43,13 @@ namespace Examples.Tutorial public ThreadedRendering() : base(800, 600) { - Keyboard.KeyDown += delegate(object sender, KeyboardKeyEventArgs e) + KeyDown += delegate(object sender, KeyboardKeyEventArgs e) { if (e.Key == Key.Escape) this.Exit(); }; - Keyboard.KeyUp += delegate(object sender, KeyboardKeyEventArgs e) + KeyUp += delegate(object sender, KeyboardKeyEventArgs e) { if (e.Key == Key.F11) if (this.WindowState == WindowState.Fullscreen) diff --git a/Source/Examples/OpenTK/GameWindow/MouseCursorSimple.cs b/Source/Examples/OpenTK/GameWindow/MouseCursorSimple.cs index 83ef22c3..c3276581 100644 --- a/Source/Examples/OpenTK/GameWindow/MouseCursorSimple.cs +++ b/Source/Examples/OpenTK/GameWindow/MouseCursorSimple.cs @@ -23,7 +23,7 @@ namespace Examples.Tutorial public MouseCursorSimple() : base(800, 600) { - Keyboard.KeyDown += Keyboard_KeyDown; + KeyDown += Keyboard_KeyDown; using (Bitmap bitmap = new Bitmap("Data/Textures/cursor.png")) { @@ -37,8 +37,8 @@ namespace Examples.Tutorial Cursor = MyCursor; } - Mouse.Move += Mouse_Move; - Mouse.ButtonDown += Mouse_ButtonDown; + MouseMove += Mouse_Move; + MouseDown += Mouse_ButtonDown; } void AddLine(float x, float y) @@ -71,7 +71,7 @@ namespace Examples.Tutorial void Mouse_Move(object sender, MouseMoveEventArgs e) { - if (Mouse[MouseButton.Left]) + if (e.Mouse[MouseButton.Left]) { AddLine(e.X, e.Y); } diff --git a/Source/Examples/OpenTK/Test/BasicMouseInput.cs b/Source/Examples/OpenTK/Test/BasicMouseInput.cs index 5a104726..b40d94c3 100644 --- a/Source/Examples/OpenTK/Test/BasicMouseInput.cs +++ b/Source/Examples/OpenTK/Test/BasicMouseInput.cs @@ -28,9 +28,9 @@ namespace Examples.Tests public BasicMouseInput() : base(800, 600) { - Mouse.Move += (sender, e) => + MouseMove += (sender, e) => { - if (Mouse[MouseButton.Left]) + if (e.Mouse[MouseButton.Left]) { // Scale mouse coordinates from // (0, 0):(Width, Height) to @@ -48,7 +48,7 @@ namespace Examples.Tests protected override void OnLoad(EventArgs e) { - this.Mouse.ButtonUp += (object sender, MouseButtonEventArgs buttonEvent) => { + MouseUp += (object sender, MouseButtonEventArgs buttonEvent) => { Console.WriteLine("Mouse button up: " + buttonEvent.Button + " at: " + buttonEvent.Position); }; } @@ -65,10 +65,12 @@ namespace Examples.Tests Console.WriteLine("The A key is down!"); } - if (Keyboard[OpenTK.Input.Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + + if (keyboard[OpenTK.Input.Key.Escape]) this.Exit(); - if (Keyboard[OpenTK.Input.Key.F11]) + if (keyboard[OpenTK.Input.Key.F11]) if (WindowState != WindowState.Fullscreen) WindowState = WindowState.Fullscreen; else @@ -94,8 +96,9 @@ namespace Examples.Tests GL.End(); SwapBuffers(); - - if (Keyboard[Key.Space]) + + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[Key.Space]) { // Simulate high load (4 fps) to check // mouse input behavior diff --git a/Source/Examples/OpenTK/Test/GameWindowStates.cs b/Source/Examples/OpenTK/Test/GameWindowStates.cs index 2c21a54d..768f29a9 100644 --- a/Source/Examples/OpenTK/Test/GameWindowStates.cs +++ b/Source/Examples/OpenTK/Test/GameWindowStates.cs @@ -14,6 +14,8 @@ using OpenTK.Graphics; using OpenTK.Graphics.OpenGL; using OpenTK.Input; +#pragma warning disable 612,618 // disable obsolete warnings - we need to access these functions + namespace Examples.Tests { [Example("GameWindow States", ExampleCategory.OpenTK, "GameWindow", 4, Documentation = "GameWindowStates")] diff --git a/Source/Examples/OpenTK/Test/InputLogger.Designer.cs b/Source/Examples/OpenTK/Test/InputLogger.Designer.cs deleted file mode 100644 index 8b0e3f5c..00000000 --- a/Source/Examples/OpenTK/Test/InputLogger.Designer.cs +++ /dev/null @@ -1,682 +0,0 @@ -namespace Examples.Tests -{ - partial class InputLogger - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.tabControl = new System.Windows.Forms.TabControl(); - this.Keyboard = new System.Windows.Forms.TabPage(); - this.label4 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.listBox4 = new System.Windows.Forms.ListBox(); - this.listBox3 = new System.Windows.Forms.ListBox(); - this.listBox2 = new System.Windows.Forms.ListBox(); - this.listBox1 = new System.Windows.Forms.ListBox(); - this.Mouse = new System.Windows.Forms.TabPage(); - this.WindowY = new System.Windows.Forms.Label(); - this.WindowX = new System.Windows.Forms.Label(); - this.MouseYWindow = new System.Windows.Forms.TextBox(); - this.MouseXWindow = new System.Windows.Forms.TextBox(); - this.MouseWheelDelta = new System.Windows.Forms.TextBox(); - this.WheelDelta = new System.Windows.Forms.Label(); - this.MouseWheelText = new System.Windows.Forms.TextBox(); - this.MouseWheelLabel = new System.Windows.Forms.Label(); - this.MouseDeltaY = new System.Windows.Forms.Label(); - this.MouseDeltaX = new System.Windows.Forms.Label(); - this.MouseY = new System.Windows.Forms.Label(); - this.MouseX = new System.Windows.Forms.Label(); - this.MouseDYText = new System.Windows.Forms.TextBox(); - this.MouseDXText = new System.Windows.Forms.TextBox(); - this.MouseYText = new System.Windows.Forms.TextBox(); - this.MouseXText = new System.Windows.Forms.TextBox(); - this.MouseButtonsBox = new System.Windows.Forms.ListBox(); - this.ChooseMouse = new System.Windows.Forms.ComboBox(); - this.HID = new System.Windows.Forms.TabPage(); - this.PollTimer = new System.Windows.Forms.Timer(this.components); - this.comboBoxActiveJoystick = new System.Windows.Forms.ComboBox(); - this.textBoxAxis1 = new System.Windows.Forms.TextBox(); - this.textBoxAxis2 = new System.Windows.Forms.TextBox(); - this.textBoxAxis3 = new System.Windows.Forms.TextBox(); - this.textBoxAxis4 = new System.Windows.Forms.TextBox(); - this.textBoxAxis5 = new System.Windows.Forms.TextBox(); - this.textBoxAxis6 = new System.Windows.Forms.TextBox(); - this.textBoxAxis7 = new System.Windows.Forms.TextBox(); - this.textBoxAxis8 = new System.Windows.Forms.TextBox(); - this.textBoxAxis9 = new System.Windows.Forms.TextBox(); - this.textBoxAxis10 = new System.Windows.Forms.TextBox(); - this.labelAxis1 = new System.Windows.Forms.Label(); - this.labelAxis2 = new System.Windows.Forms.Label(); - this.labelAxis3 = new System.Windows.Forms.Label(); - this.labelAxis4 = new System.Windows.Forms.Label(); - this.labelAxis5 = new System.Windows.Forms.Label(); - this.labelAxis6 = new System.Windows.Forms.Label(); - this.labelAxis7 = new System.Windows.Forms.Label(); - this.labelAxis8 = new System.Windows.Forms.Label(); - this.labelAxis9 = new System.Windows.Forms.Label(); - this.labelAxis10 = new System.Windows.Forms.Label(); - this.JoystickButtonsBox = new System.Windows.Forms.ListBox(); - this.tabControl.SuspendLayout(); - this.Keyboard.SuspendLayout(); - this.Mouse.SuspendLayout(); - this.HID.SuspendLayout(); - this.SuspendLayout(); - // - // tabControl - // - this.tabControl.Controls.Add(this.Keyboard); - this.tabControl.Controls.Add(this.Mouse); - this.tabControl.Controls.Add(this.HID); - this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControl.Location = new System.Drawing.Point(0, 0); - this.tabControl.Name = "tabControl"; - this.tabControl.SelectedIndex = 0; - this.tabControl.Size = new System.Drawing.Size(432, 379); - this.tabControl.TabIndex = 0; - // - // Keyboard - // - this.Keyboard.BackColor = System.Drawing.SystemColors.ControlLight; - this.Keyboard.Controls.Add(this.label4); - this.Keyboard.Controls.Add(this.label3); - this.Keyboard.Controls.Add(this.label2); - this.Keyboard.Controls.Add(this.label1); - this.Keyboard.Controls.Add(this.listBox4); - this.Keyboard.Controls.Add(this.listBox3); - this.Keyboard.Controls.Add(this.listBox2); - this.Keyboard.Controls.Add(this.listBox1); - this.Keyboard.Location = new System.Drawing.Point(4, 22); - this.Keyboard.Name = "Keyboard"; - this.Keyboard.Padding = new System.Windows.Forms.Padding(3); - this.Keyboard.Size = new System.Drawing.Size(424, 352); - this.Keyboard.TabIndex = 0; - this.Keyboard.Text = "Keyboard"; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(207, 180); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(64, 13); - this.label4.TabIndex = 7; - this.label4.Text = "Keyboard 4"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(6, 180); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(64, 13); - this.label3.TabIndex = 6; - this.label3.Text = "Keyboard 3"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(207, 3); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(64, 13); - this.label2.TabIndex = 5; - this.label2.Text = "Keyboard 2"; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(8, 3); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(64, 13); - this.label1.TabIndex = 4; - this.label1.Text = "Keyboard 1"; - // - // listBox4 - // - this.listBox4.FormattingEnabled = true; - this.listBox4.Location = new System.Drawing.Point(210, 197); - this.listBox4.Name = "listBox4"; - this.listBox4.Size = new System.Drawing.Size(206, 147); - this.listBox4.TabIndex = 3; - // - // listBox3 - // - this.listBox3.FormattingEnabled = true; - this.listBox3.Location = new System.Drawing.Point(9, 197); - this.listBox3.Name = "listBox3"; - this.listBox3.Size = new System.Drawing.Size(195, 147); - this.listBox3.TabIndex = 2; - // - // listBox2 - // - this.listBox2.FormattingEnabled = true; - this.listBox2.Location = new System.Drawing.Point(210, 20); - this.listBox2.Name = "listBox2"; - this.listBox2.Size = new System.Drawing.Size(206, 147); - this.listBox2.TabIndex = 1; - // - // listBox1 - // - this.listBox1.FormattingEnabled = true; - this.listBox1.Location = new System.Drawing.Point(9, 20); - this.listBox1.Name = "listBox1"; - this.listBox1.Size = new System.Drawing.Size(195, 147); - this.listBox1.TabIndex = 0; - // - // Mouse - // - this.Mouse.BackColor = System.Drawing.SystemColors.ControlLight; - this.Mouse.Controls.Add(this.WindowY); - this.Mouse.Controls.Add(this.WindowX); - this.Mouse.Controls.Add(this.MouseYWindow); - this.Mouse.Controls.Add(this.MouseXWindow); - this.Mouse.Controls.Add(this.MouseWheelDelta); - this.Mouse.Controls.Add(this.WheelDelta); - this.Mouse.Controls.Add(this.MouseWheelText); - this.Mouse.Controls.Add(this.MouseWheelLabel); - this.Mouse.Controls.Add(this.MouseDeltaY); - this.Mouse.Controls.Add(this.MouseDeltaX); - this.Mouse.Controls.Add(this.MouseY); - this.Mouse.Controls.Add(this.MouseX); - this.Mouse.Controls.Add(this.MouseDYText); - this.Mouse.Controls.Add(this.MouseDXText); - this.Mouse.Controls.Add(this.MouseYText); - this.Mouse.Controls.Add(this.MouseXText); - this.Mouse.Controls.Add(this.MouseButtonsBox); - this.Mouse.Controls.Add(this.ChooseMouse); - this.Mouse.Location = new System.Drawing.Point(4, 22); - this.Mouse.Name = "Mouse"; - this.Mouse.Padding = new System.Windows.Forms.Padding(3); - this.Mouse.Size = new System.Drawing.Size(424, 353); - this.Mouse.TabIndex = 1; - this.Mouse.Text = "Mouse"; - // - // WindowY - // - this.WindowY.AutoSize = true; - this.WindowY.Location = new System.Drawing.Point(4, 239); - this.WindowY.Name = "WindowY"; - this.WindowY.Size = new System.Drawing.Size(62, 13); - this.WindowY.TabIndex = 17; - this.WindowY.Text = "Window Y:"; - // - // WindowX - // - this.WindowX.AutoSize = true; - this.WindowX.Location = new System.Drawing.Point(4, 212); - this.WindowX.Name = "WindowX"; - this.WindowX.Size = new System.Drawing.Size(63, 13); - this.WindowX.TabIndex = 16; - this.WindowX.Text = "Window X:"; - // - // MouseYWindow - // - this.MouseYWindow.Location = new System.Drawing.Point(80, 232); - this.MouseYWindow.Name = "MouseYWindow"; - this.MouseYWindow.ReadOnly = true; - this.MouseYWindow.Size = new System.Drawing.Size(73, 22); - this.MouseYWindow.TabIndex = 15; - // - // MouseXWindow - // - this.MouseXWindow.Location = new System.Drawing.Point(80, 205); - this.MouseXWindow.Name = "MouseXWindow"; - this.MouseXWindow.ReadOnly = true; - this.MouseXWindow.Size = new System.Drawing.Size(73, 22); - this.MouseXWindow.TabIndex = 14; - // - // MouseWheelDelta - // - this.MouseWheelDelta.Location = new System.Drawing.Point(80, 178); - this.MouseWheelDelta.Name = "MouseWheelDelta"; - this.MouseWheelDelta.ReadOnly = true; - this.MouseWheelDelta.Size = new System.Drawing.Size(73, 22); - this.MouseWheelDelta.TabIndex = 13; - // - // WheelDelta - // - this.WheelDelta.AutoSize = true; - this.WheelDelta.Location = new System.Drawing.Point(4, 185); - this.WheelDelta.Name = "WheelDelta"; - this.WheelDelta.Size = new System.Drawing.Size(73, 13); - this.WheelDelta.TabIndex = 12; - this.WheelDelta.Text = "Wheel Delta:"; - // - // MouseWheelText - // - this.MouseWheelText.Location = new System.Drawing.Point(80, 152); - this.MouseWheelText.Name = "MouseWheelText"; - this.MouseWheelText.ReadOnly = true; - this.MouseWheelText.Size = new System.Drawing.Size(73, 22); - this.MouseWheelText.TabIndex = 11; - // - // MouseWheelLabel - // - this.MouseWheelLabel.AutoSize = true; - this.MouseWheelLabel.Location = new System.Drawing.Point(4, 159); - this.MouseWheelLabel.Name = "MouseWheelLabel"; - this.MouseWheelLabel.Size = new System.Drawing.Size(43, 13); - this.MouseWheelLabel.TabIndex = 10; - this.MouseWheelLabel.Text = "Wheel:"; - // - // MouseDeltaY - // - this.MouseDeltaY.AutoSize = true; - this.MouseDeltaY.Location = new System.Drawing.Point(4, 132); - this.MouseDeltaY.Name = "MouseDeltaY"; - this.MouseDeltaY.Size = new System.Drawing.Size(45, 13); - this.MouseDeltaY.TabIndex = 9; - this.MouseDeltaY.Text = "Delta Y:"; - // - // MouseDeltaX - // - this.MouseDeltaX.AutoSize = true; - this.MouseDeltaX.Location = new System.Drawing.Point(4, 105); - this.MouseDeltaX.Name = "MouseDeltaX"; - this.MouseDeltaX.Size = new System.Drawing.Size(46, 13); - this.MouseDeltaX.TabIndex = 8; - this.MouseDeltaX.Text = "Delta X:"; - // - // MouseY - // - this.MouseY.AutoSize = true; - this.MouseY.Location = new System.Drawing.Point(4, 78); - this.MouseY.Name = "MouseY"; - this.MouseY.Size = new System.Drawing.Size(60, 13); - this.MouseY.TabIndex = 7; - this.MouseY.Text = "Position Y:"; - // - // MouseX - // - this.MouseX.AutoSize = true; - this.MouseX.Location = new System.Drawing.Point(4, 51); - this.MouseX.Name = "MouseX"; - this.MouseX.Size = new System.Drawing.Size(61, 13); - this.MouseX.TabIndex = 6; - this.MouseX.Text = "Position X:"; - // - // MouseDYText - // - this.MouseDYText.Location = new System.Drawing.Point(80, 125); - this.MouseDYText.Name = "MouseDYText"; - this.MouseDYText.ReadOnly = true; - this.MouseDYText.Size = new System.Drawing.Size(73, 22); - this.MouseDYText.TabIndex = 5; - // - // MouseDXText - // - this.MouseDXText.Location = new System.Drawing.Point(80, 98); - this.MouseDXText.Name = "MouseDXText"; - this.MouseDXText.ReadOnly = true; - this.MouseDXText.Size = new System.Drawing.Size(73, 22); - this.MouseDXText.TabIndex = 4; - // - // MouseYText - // - this.MouseYText.Location = new System.Drawing.Point(80, 71); - this.MouseYText.Name = "MouseYText"; - this.MouseYText.ReadOnly = true; - this.MouseYText.Size = new System.Drawing.Size(73, 22); - this.MouseYText.TabIndex = 3; - // - // MouseXText - // - this.MouseXText.Location = new System.Drawing.Point(80, 44); - this.MouseXText.Name = "MouseXText"; - this.MouseXText.ReadOnly = true; - this.MouseXText.Size = new System.Drawing.Size(73, 22); - this.MouseXText.TabIndex = 2; - // - // MouseButtonsBox - // - this.MouseButtonsBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.MouseButtonsBox.FormattingEnabled = true; - this.MouseButtonsBox.Location = new System.Drawing.Point(190, 44); - this.MouseButtonsBox.Name = "MouseButtonsBox"; - this.MouseButtonsBox.Size = new System.Drawing.Size(226, 303); - this.MouseButtonsBox.TabIndex = 1; - // - // ChooseMouse - // - this.ChooseMouse.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.ChooseMouse.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.ChooseMouse.FormattingEnabled = true; - this.ChooseMouse.Location = new System.Drawing.Point(7, 7); - this.ChooseMouse.Name = "ChooseMouse"; - this.ChooseMouse.Size = new System.Drawing.Size(409, 21); - this.ChooseMouse.TabIndex = 0; - this.ChooseMouse.SelectedIndexChanged += new System.EventHandler(this.ChooseMouse_SelectedIndexChanged); - // - // HID - // - this.HID.Controls.Add(this.labelAxis10); - this.HID.Controls.Add(this.labelAxis9); - this.HID.Controls.Add(this.labelAxis8); - this.HID.Controls.Add(this.labelAxis7); - this.HID.Controls.Add(this.labelAxis6); - this.HID.Controls.Add(this.labelAxis5); - this.HID.Controls.Add(this.labelAxis4); - this.HID.Controls.Add(this.labelAxis3); - this.HID.Controls.Add(this.labelAxis2); - this.HID.Controls.Add(this.labelAxis1); - this.HID.Controls.Add(this.textBoxAxis10); - this.HID.Controls.Add(this.textBoxAxis9); - this.HID.Controls.Add(this.textBoxAxis8); - this.HID.Controls.Add(this.textBoxAxis7); - this.HID.Controls.Add(this.textBoxAxis6); - this.HID.Controls.Add(this.textBoxAxis5); - this.HID.Controls.Add(this.textBoxAxis4); - this.HID.Controls.Add(this.textBoxAxis3); - this.HID.Controls.Add(this.textBoxAxis2); - this.HID.Controls.Add(this.textBoxAxis1); - this.HID.Controls.Add(this.JoystickButtonsBox); - this.HID.Controls.Add(this.comboBoxActiveJoystick); - this.HID.Location = new System.Drawing.Point(4, 22); - this.HID.Name = "HID"; - this.HID.Padding = new System.Windows.Forms.Padding(3); - this.HID.Size = new System.Drawing.Size(424, 353); - this.HID.TabIndex = 2; - this.HID.Text = "HID"; - this.HID.UseVisualStyleBackColor = true; - // - // PollTimer - // - this.PollTimer.Interval = 10; - // - // comboBoxActiveJoystick - // - this.comboBoxActiveJoystick.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.comboBoxActiveJoystick.FormattingEnabled = true; - this.comboBoxActiveJoystick.Location = new System.Drawing.Point(7, 7); - this.comboBoxActiveJoystick.Name = "comboBoxActiveJoystick"; - this.comboBoxActiveJoystick.Size = new System.Drawing.Size(409, 21); - this.comboBoxActiveJoystick.TabIndex = 0; - // - // textBoxAxis1 - // - this.textBoxAxis1.Location = new System.Drawing.Point(55, 43); - this.textBoxAxis1.Name = "textBoxAxis1"; - this.textBoxAxis1.ReadOnly = true; - this.textBoxAxis1.Size = new System.Drawing.Size(129, 22); - this.textBoxAxis1.TabIndex = 2; - // - // textBoxAxis2 - // - this.textBoxAxis2.Location = new System.Drawing.Point(55, 72); - this.textBoxAxis2.Name = "textBoxAxis2"; - this.textBoxAxis2.ReadOnly = true; - this.textBoxAxis2.Size = new System.Drawing.Size(129, 22); - this.textBoxAxis2.TabIndex = 3; - // - // textBoxAxis3 - // - this.textBoxAxis3.Location = new System.Drawing.Point(55, 101); - this.textBoxAxis3.Name = "textBoxAxis3"; - this.textBoxAxis3.ReadOnly = true; - this.textBoxAxis3.Size = new System.Drawing.Size(129, 22); - this.textBoxAxis3.TabIndex = 4; - // - // textBoxAxis4 - // - this.textBoxAxis4.Location = new System.Drawing.Point(55, 130); - this.textBoxAxis4.Name = "textBoxAxis4"; - this.textBoxAxis4.ReadOnly = true; - this.textBoxAxis4.Size = new System.Drawing.Size(129, 22); - this.textBoxAxis4.TabIndex = 5; - // - // textBoxAxis5 - // - this.textBoxAxis5.Location = new System.Drawing.Point(55, 158); - this.textBoxAxis5.Name = "textBoxAxis5"; - this.textBoxAxis5.ReadOnly = true; - this.textBoxAxis5.Size = new System.Drawing.Size(129, 22); - this.textBoxAxis5.TabIndex = 6; - // - // textBoxAxis6 - // - this.textBoxAxis6.Location = new System.Drawing.Point(55, 186); - this.textBoxAxis6.Name = "textBoxAxis6"; - this.textBoxAxis6.ReadOnly = true; - this.textBoxAxis6.Size = new System.Drawing.Size(129, 22); - this.textBoxAxis6.TabIndex = 7; - // - // textBoxAxis7 - // - this.textBoxAxis7.Location = new System.Drawing.Point(55, 214); - this.textBoxAxis7.Name = "textBoxAxis7"; - this.textBoxAxis7.ReadOnly = true; - this.textBoxAxis7.Size = new System.Drawing.Size(129, 22); - this.textBoxAxis7.TabIndex = 8; - // - // textBoxAxis8 - // - this.textBoxAxis8.Location = new System.Drawing.Point(55, 242); - this.textBoxAxis8.Name = "textBoxAxis8"; - this.textBoxAxis8.ReadOnly = true; - this.textBoxAxis8.Size = new System.Drawing.Size(129, 22); - this.textBoxAxis8.TabIndex = 9; - // - // textBoxAxis9 - // - this.textBoxAxis9.Location = new System.Drawing.Point(55, 270); - this.textBoxAxis9.Name = "textBoxAxis9"; - this.textBoxAxis9.ReadOnly = true; - this.textBoxAxis9.Size = new System.Drawing.Size(129, 22); - this.textBoxAxis9.TabIndex = 10; - // - // textBoxAxis10 - // - this.textBoxAxis10.Location = new System.Drawing.Point(55, 298); - this.textBoxAxis10.Name = "textBoxAxis10"; - this.textBoxAxis10.ReadOnly = true; - this.textBoxAxis10.Size = new System.Drawing.Size(129, 22); - this.textBoxAxis10.TabIndex = 11; - // - // labelAxis1 - // - this.labelAxis1.AutoSize = true; - this.labelAxis1.Location = new System.Drawing.Point(4, 46); - this.labelAxis1.Name = "labelAxis1"; - this.labelAxis1.Size = new System.Drawing.Size(39, 13); - this.labelAxis1.TabIndex = 12; - this.labelAxis1.Text = "Axis 1:"; - // - // labelAxis2 - // - this.labelAxis2.AutoSize = true; - this.labelAxis2.Location = new System.Drawing.Point(4, 75); - this.labelAxis2.Name = "labelAxis2"; - this.labelAxis2.Size = new System.Drawing.Size(39, 13); - this.labelAxis2.TabIndex = 13; - this.labelAxis2.Text = "Axis 2:"; - // - // labelAxis3 - // - this.labelAxis3.AutoSize = true; - this.labelAxis3.Location = new System.Drawing.Point(4, 104); - this.labelAxis3.Name = "labelAxis3"; - this.labelAxis3.Size = new System.Drawing.Size(39, 13); - this.labelAxis3.TabIndex = 14; - this.labelAxis3.Text = "Axis 3:"; - // - // labelAxis4 - // - this.labelAxis4.AutoSize = true; - this.labelAxis4.Location = new System.Drawing.Point(4, 133); - this.labelAxis4.Name = "labelAxis4"; - this.labelAxis4.Size = new System.Drawing.Size(39, 13); - this.labelAxis4.TabIndex = 15; - this.labelAxis4.Text = "Axis 4:"; - // - // labelAxis5 - // - this.labelAxis5.AutoSize = true; - this.labelAxis5.Location = new System.Drawing.Point(4, 161); - this.labelAxis5.Name = "labelAxis5"; - this.labelAxis5.Size = new System.Drawing.Size(39, 13); - this.labelAxis5.TabIndex = 16; - this.labelAxis5.Text = "Axis 5:"; - // - // labelAxis6 - // - this.labelAxis6.AutoSize = true; - this.labelAxis6.Location = new System.Drawing.Point(4, 189); - this.labelAxis6.Name = "labelAxis6"; - this.labelAxis6.Size = new System.Drawing.Size(39, 13); - this.labelAxis6.TabIndex = 17; - this.labelAxis6.Text = "Axis 6:"; - // - // labelAxis7 - // - this.labelAxis7.AutoSize = true; - this.labelAxis7.Location = new System.Drawing.Point(4, 217); - this.labelAxis7.Name = "labelAxis7"; - this.labelAxis7.Size = new System.Drawing.Size(39, 13); - this.labelAxis7.TabIndex = 18; - this.labelAxis7.Text = "Axis 7:"; - // - // labelAxis8 - // - this.labelAxis8.AutoSize = true; - this.labelAxis8.Location = new System.Drawing.Point(4, 245); - this.labelAxis8.Name = "labelAxis8"; - this.labelAxis8.Size = new System.Drawing.Size(39, 13); - this.labelAxis8.TabIndex = 18; - this.labelAxis8.Text = "Axis 8:"; - // - // labelAxis9 - // - this.labelAxis9.AutoSize = true; - this.labelAxis9.Location = new System.Drawing.Point(4, 273); - this.labelAxis9.Name = "labelAxis9"; - this.labelAxis9.Size = new System.Drawing.Size(39, 13); - this.labelAxis9.TabIndex = 19; - this.labelAxis9.Text = "Axis 9:"; - // - // labelAxis10 - // - this.labelAxis10.AutoSize = true; - this.labelAxis10.Location = new System.Drawing.Point(4, 301); - this.labelAxis10.Name = "labelAxis10"; - this.labelAxis10.Size = new System.Drawing.Size(45, 13); - this.labelAxis10.TabIndex = 20; - this.labelAxis10.Text = "Axis 10:"; - // - // JoystickButtonsBox - // - this.JoystickButtonsBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.JoystickButtonsBox.FormattingEnabled = true; - this.JoystickButtonsBox.Location = new System.Drawing.Point(190, 43); - this.JoystickButtonsBox.Name = "JoystickButtonsBox"; - this.JoystickButtonsBox.Size = new System.Drawing.Size(226, 303); - this.JoystickButtonsBox.TabIndex = 1; - // - // InputLogger - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(432, 379); - this.Controls.Add(this.tabControl); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.Name = "InputLogger"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "S04: Input Logger"; - this.tabControl.ResumeLayout(false); - this.Keyboard.ResumeLayout(false); - this.Keyboard.PerformLayout(); - this.Mouse.ResumeLayout(false); - this.Mouse.PerformLayout(); - this.HID.ResumeLayout(false); - this.HID.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.TabControl tabControl; - private System.Windows.Forms.TabPage Keyboard; - private System.Windows.Forms.TabPage Mouse; - private System.Windows.Forms.TabPage HID; - private System.Windows.Forms.ListBox listBox4; - private System.Windows.Forms.ListBox listBox3; - private System.Windows.Forms.ListBox listBox2; - private System.Windows.Forms.ListBox listBox1; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.ComboBox ChooseMouse; - private System.Windows.Forms.ListBox MouseButtonsBox; - private System.Windows.Forms.Label MouseDeltaY; - private System.Windows.Forms.Label MouseDeltaX; - private System.Windows.Forms.Label MouseY; - private System.Windows.Forms.Label MouseX; - private System.Windows.Forms.TextBox MouseDYText; - private System.Windows.Forms.TextBox MouseDXText; - private System.Windows.Forms.TextBox MouseYText; - private System.Windows.Forms.TextBox MouseXText; - private System.Windows.Forms.TextBox MouseWheelText; - private System.Windows.Forms.Label MouseWheelLabel; - private System.Windows.Forms.TextBox MouseWheelDelta; - private System.Windows.Forms.Label WheelDelta; - private System.Windows.Forms.Timer PollTimer; - private System.Windows.Forms.TextBox MouseXWindow; - private System.Windows.Forms.Label WindowY; - private System.Windows.Forms.Label WindowX; - private System.Windows.Forms.TextBox MouseYWindow; - private System.Windows.Forms.ComboBox comboBoxActiveJoystick; - private System.Windows.Forms.Label labelAxis10; - private System.Windows.Forms.Label labelAxis9; - private System.Windows.Forms.Label labelAxis8; - private System.Windows.Forms.Label labelAxis7; - private System.Windows.Forms.Label labelAxis6; - private System.Windows.Forms.Label labelAxis5; - private System.Windows.Forms.Label labelAxis4; - private System.Windows.Forms.Label labelAxis3; - private System.Windows.Forms.Label labelAxis2; - private System.Windows.Forms.Label labelAxis1; - private System.Windows.Forms.TextBox textBoxAxis10; - private System.Windows.Forms.TextBox textBoxAxis9; - private System.Windows.Forms.TextBox textBoxAxis8; - private System.Windows.Forms.TextBox textBoxAxis7; - private System.Windows.Forms.TextBox textBoxAxis6; - private System.Windows.Forms.TextBox textBoxAxis5; - private System.Windows.Forms.TextBox textBoxAxis4; - private System.Windows.Forms.TextBox textBoxAxis3; - private System.Windows.Forms.TextBox textBoxAxis2; - private System.Windows.Forms.TextBox textBoxAxis1; - private System.Windows.Forms.ListBox JoystickButtonsBox; - - } -} \ No newline at end of file diff --git a/Source/Examples/OpenTK/Test/InputLogger.cs b/Source/Examples/OpenTK/Test/InputLogger.cs deleted file mode 100644 index 3ef58210..00000000 --- a/Source/Examples/OpenTK/Test/InputLogger.cs +++ /dev/null @@ -1,311 +0,0 @@ -#region --- License --- -/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos - * See license.txt for license info - */ -#endregion - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; - -using OpenTK; -using OpenTK.Platform; -using OpenTK.Input; -using System.Diagnostics; -using System.Threading; - -using OpenTK.Graphics; -using OpenTK.Graphics.OpenGL; - -namespace Examples.Tests -{ - [Example("Input Logger", ExampleCategory.OpenTK, "Test", Documentation="InputLogger")] - public partial class InputLogger : Form - { - #region Fields - - Thread thread; - GameWindow hidden; - bool start; - Dictionary keyboardListBoxes = new Dictionary(4); - - #endregion - - #region Constructors - - public InputLogger() - { - InitializeComponent(); - } - - #endregion - - #region GameWindow - - void LaunchGameWindow() - { - hidden = new GameWindow(320, 240, GraphicsMode.Default, "OpenTK | Hidden input window"); - hidden.Load += hidden_Load; - hidden.Unload += hidden_Unload; - hidden.RenderFrame += hidden_RenderFrame; - hidden.Run(60.0, 0.0); - } - - void hidden_RenderFrame(object sender, FrameEventArgs e) - { - GL.Clear(ClearBufferMask.ColorBufferBit); - ((GameWindow)sender).SwapBuffers(); - } - - void hidden_Load(object sender, EventArgs e) - { - hidden.VSync = VSyncMode.On; - start = true; - GL.ClearColor(Color.Black); - } - - void hidden_Unload(object sender, EventArgs e) - { - this.BeginInvoke(on_hidden_unload, sender, e, this); - } - - delegate void CloseTrigger(GameWindow sender, EventArgs e, Form f); - CloseTrigger on_hidden_unload = delegate(GameWindow sender, EventArgs e, Form f) { f.Close(); }; - - #endregion - - #region Protected Members - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - - thread = new Thread(LaunchGameWindow); - thread.Start(); - - while (!start) - Thread.Sleep(100); - - keyboardListBoxes.Add(hidden.Keyboard.DeviceID, listBox1); - - // Add available mice to the mouse input logger. - ChooseMouse.Items.Add(String.Format("Mouse {0} ({1})", 0, hidden.Mouse.Description)); - ChooseMouse.SelectedIndex = 0; - - hidden.Mouse.Move += LogMouseMove; - hidden.Mouse.WheelChanged += LogMouseWheelChanged; - hidden.Mouse.ButtonDown += LogMouseButtonDown; - hidden.Mouse.ButtonUp += LogMouseButtonUp; - - hidden.Keyboard.KeyDown += LogKeyDown; - hidden.Keyboard.KeyUp += LogKeyUp; - - #region Joysticks - - foreach (JoystickDevice joystick in hidden.Joysticks) - { - comboBoxActiveJoystick.Items.Add(joystick.Description); - - joystick.Move += delegate(object sender, JoystickMoveEventArgs args) - { - this.BeginInvoke(ControlLogJoystickMoved, this, sender, args); - }; - joystick.ButtonDown += delegate(object sender, JoystickButtonEventArgs args) - { - this.BeginInvoke(ControlLogJoystickButtonDown, this, sender, args); - }; - joystick.ButtonUp += delegate(object sender, JoystickButtonEventArgs args) - { - this.BeginInvoke(ControlLogJoystickButtonUp, this, sender, args); - }; - } - if (comboBoxActiveJoystick.Items.Count > 0) - comboBoxActiveJoystick.SelectedIndex = 0; - - #endregion - } - - protected override void OnClosing(CancelEventArgs e) - { - base.OnClosing(e); - - hidden.Exit(); - - while (hidden.Exists) - Thread.Sleep(100); - - e.Cancel = false; - } - - #endregion - - #region Private Members - - private void ChooseMouse_SelectedIndexChanged(object sender, EventArgs e) - { - MouseButtonsBox.Items.Clear(); - } - - #endregion - - #region Logging Delegates - - #region Mice - - delegate void ControlLogMouseKey(GameWindow input_window, InputLogger control, object sender, MouseButtonEventArgs e); - ControlLogMouseKey ControlLogMouseKeyDown = - delegate(GameWindow input_window, InputLogger control, object sender, MouseButtonEventArgs e) - { - if ((sender as MouseDevice).DeviceID == input_window.Mouse.DeviceID) - { - control.MouseButtonsBox.Items.Add(e.Button); - System.Diagnostics.Debug.Print("Button down: {0}", e.Button); - } - }; - ControlLogMouseKey ControlLogMouseKeyUp = - delegate(GameWindow input_window, InputLogger control, object sender, MouseButtonEventArgs e) - { - if ((sender as MouseDevice).DeviceID == input_window.Mouse.DeviceID) - { - control.MouseButtonsBox.Items.Remove(e.Button); - System.Diagnostics.Debug.Print("Button up: {0}", e.Button); - } - }; - - delegate void ControlLogMouseMove(GameWindow input_window, InputLogger control, object sender, MouseMoveEventArgs e); - ControlLogMouseMove ControlLogMouseMoveChanges = - delegate(GameWindow input_window, InputLogger control, object sender, MouseMoveEventArgs e) - { - control.MouseXText.Text = e.X.ToString(); - control.MouseYText.Text = e.Y.ToString(); - }; - - delegate void ControlLogMouseWheel(GameWindow input_window, InputLogger control, object sender, MouseWheelEventArgs e); - ControlLogMouseWheel ControlLogMouseWheelChanges = - delegate(GameWindow input_window, InputLogger control, object sender, MouseWheelEventArgs e) - { - control.MouseWheelText.Text = e.ValuePrecise.ToString("F2"); - }; - - #endregion - - #region Keyboards - - delegate void ControlLogKeyboard(GameWindow input_window, InputLogger control, OpenTK.Input.KeyboardDevice sender, KeyboardKeyEventArgs e); - ControlLogKeyboard ControlLogKeyboardDown = - delegate(GameWindow input_window, InputLogger control, KeyboardDevice sender, KeyboardKeyEventArgs e) - { - control.keyboardListBoxes[sender.DeviceID].Items.Add(e.Key); - }; - ControlLogKeyboard ControlLogKeyboardUp = - delegate(GameWindow input_window, InputLogger control, KeyboardDevice sender, KeyboardKeyEventArgs e) - { - control.keyboardListBoxes[sender.DeviceID].Items.Remove(e.Key); - }; - - #endregion - - #region Joysticks - - delegate void ControlLogJoystickMove(InputLogger control, object sender, JoystickMoveEventArgs e); - ControlLogJoystickMove ControlLogJoystickMoved = - delegate(InputLogger control, object sender, JoystickMoveEventArgs e) - { - // Yes, there are things such as arrays. Tell that to the visual studio designer! - switch (e.Axis) - { - case JoystickAxis.Axis0: control.textBoxAxis1.Text = e.Value.ToString(); break; - case JoystickAxis.Axis1: control.textBoxAxis2.Text = e.Value.ToString(); break; - case JoystickAxis.Axis2: control.textBoxAxis3.Text = e.Value.ToString(); break; - case JoystickAxis.Axis3: control.textBoxAxis4.Text = e.Value.ToString(); break; - case JoystickAxis.Axis4: control.textBoxAxis5.Text = e.Value.ToString(); break; - case JoystickAxis.Axis5: control.textBoxAxis6.Text = e.Value.ToString(); break; - case JoystickAxis.Axis6: control.textBoxAxis7.Text = e.Value.ToString(); break; - case JoystickAxis.Axis7: control.textBoxAxis8.Text = e.Value.ToString(); break; - case JoystickAxis.Axis8: control.textBoxAxis9.Text = e.Value.ToString(); break; - case JoystickAxis.Axis9: control.textBoxAxis10.Text = e.Value.ToString(); break; - } - }; - - delegate void ControlLogJoystickButton(InputLogger control, object sender, JoystickButtonEventArgs e); - ControlLogJoystickButton ControlLogJoystickButtonDown = - delegate(InputLogger control, object sender, JoystickButtonEventArgs e) - { - if ((sender as JoystickDevice).Description == control.comboBoxActiveJoystick.Text) - { - control.JoystickButtonsBox.Items.Add(e.Button); - System.Diagnostics.Debug.Print("Joystick button down: {0}", e.Button); - } - }; - ControlLogJoystickButton ControlLogJoystickButtonUp = - delegate(InputLogger control, object sender, JoystickButtonEventArgs e) - { - if ((sender as JoystickDevice).Description == control.comboBoxActiveJoystick.Text) - { - control.JoystickButtonsBox.Items.Remove(e.Button); - System.Diagnostics.Debug.Print("Joystick button down: {0}", e.Button); - } - }; - - #endregion - - #endregion - - #region Input Event Handlers - - void LogMouseMove(object sender, MouseMoveEventArgs e) - { - this.BeginInvoke(ControlLogMouseMoveChanges, hidden, this, sender, e); - } - - void LogMouseWheelChanged(object sender, MouseWheelEventArgs e) - { - this.BeginInvoke(ControlLogMouseWheelChanges, hidden, this, sender, e); - } - - void LogMouseButtonDown(object sender, MouseButtonEventArgs e) - { - this.BeginInvoke(ControlLogMouseKeyDown, hidden, this, sender, e); - } - - void LogMouseButtonUp(object sender, MouseButtonEventArgs e) - { - this.BeginInvoke(ControlLogMouseKeyUp, hidden, this, sender, e); - } - - void LogKeyDown(object sender, KeyboardKeyEventArgs key) - { - this.BeginInvoke(ControlLogKeyboardDown, hidden, this, sender, key); - } - - void LogKeyUp(object sender, KeyboardKeyEventArgs key) - { - this.BeginInvoke(ControlLogKeyboardUp, hidden, this, sender, key); - } - - #endregion - - #region public static void Main() - - /// - /// Entry point of this example. - /// - [STAThread] - public static void Main() - { - using (InputLogger example = new InputLogger()) - { - // Get the title and category of this example using reflection. - ExampleAttribute info = ((ExampleAttribute)example.GetType().GetCustomAttributes(false)[0]); - example.Text = String.Format("OpenTK | {0} {1}: {2}", info.Category, info.Difficulty, info.Title); - example.ShowDialog(); - } - } - - #endregion - } -} diff --git a/Source/Examples/OpenTK/Test/InputLogger.resx b/Source/Examples/OpenTK/Test/InputLogger.resx deleted file mode 100644 index b19ade6e..00000000 --- a/Source/Examples/OpenTK/Test/InputLogger.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - \ No newline at end of file diff --git a/Source/Examples/OpenTK/Test/MatrixTest.cs b/Source/Examples/OpenTK/Test/MatrixTest.cs index 690ae2d6..e19646b6 100644 --- a/Source/Examples/OpenTK/Test/MatrixTest.cs +++ b/Source/Examples/OpenTK/Test/MatrixTest.cs @@ -19,8 +19,6 @@ namespace Examples.Tests float y = 1.0f; float z = 1.0f; - Matrix4 createdTranslation = Matrix4.CreateTranslation(new Vector3(2, 3, -1)); - Matrix4 translation = new Matrix4(new Vector4(1, 0, 0, 2), new Vector4(0, 1, 0, 3), new Vector4(0, 0, 1, -1), new Vector4(0, 0, 0, 1)); Vector4 point = new Vector4(x, y, z, 1); diff --git a/Source/Examples/OpenTK/Test/Multithreading.cs b/Source/Examples/OpenTK/Test/Multithreading.cs index 77c90f8f..7e8383be 100644 --- a/Source/Examples/OpenTK/Test/Multithreading.cs +++ b/Source/Examples/OpenTK/Test/Multithreading.cs @@ -39,7 +39,7 @@ namespace Examples.Tests using (Tutorial.T03_Immediate_Mode_Cube game = new Examples.Tutorial.T03_Immediate_Mode_Cube()) { Utilities.SetWindowTitle(game); - game.Keyboard.KeyUp += delegate(object sender, OpenTK.Input.KeyboardKeyEventArgs e) + game.KeyUp += delegate(object sender, OpenTK.Input.KeyboardKeyEventArgs e) { if (e.Key == OpenTK.Input.Key.F11) { diff --git a/Source/Examples/OpenTK/Test/TestShaderUtf8Support.cs b/Source/Examples/OpenTK/Test/TestShaderUtf8Support.cs index b410fca0..f61a3b2b 100644 --- a/Source/Examples/OpenTK/Test/TestShaderUtf8Support.cs +++ b/Source/Examples/OpenTK/Test/TestShaderUtf8Support.cs @@ -207,7 +207,8 @@ void main(void) Matrix4.Mult(ref rotation, ref modelviewMatrix, out modelviewMatrix); GL.UniformMatrix4(modelviewMatrixLocation, false, ref modelviewMatrix); - if (Keyboard[OpenTK.Input.Key.Escape]) + var keyboard = OpenTK.Input.Keyboard.GetState(); + if (keyboard[OpenTK.Input.Key.Escape]) Exit(); } diff --git a/Source/Examples/Shapes/Helpers/MengerCube.cs b/Source/Examples/Shapes/Helpers/MengerCube.cs index d7360ad9..763ddc45 100644 --- a/Source/Examples/Shapes/Helpers/MengerCube.cs +++ b/Source/Examples/Shapes/Helpers/MengerCube.cs @@ -119,8 +119,6 @@ namespace Examples.Shapes double _Six = 0.66666666666666; // 2/3 double _One = 1.0; // 3/3 - double ThirdLength = SideLength / 3f; - Vector3d C0 = Center + new Vector3d( -SideLength, -SideLength, +SideLength ); Vector3d C1 = Center + new Vector3d( +SideLength, -SideLength, +SideLength ); Vector3d C2 = Center + new Vector3d( +SideLength, +SideLength, +SideLength ); diff --git a/Source/OpenTK/DisplayDevice.cs b/Source/OpenTK/DisplayDevice.cs index 00789473..bfd3960a 100644 --- a/Source/OpenTK/DisplayDevice.cs +++ b/Source/OpenTK/DisplayDevice.cs @@ -78,11 +78,13 @@ namespace OpenTK object id) : this() { -#warning "Consolidate current resolution with bounds? Can they fall out of sync right now?" + // Todo: Consolidate current resolution with bounds? Can they fall out of sync right now? this.current_resolution = currentResolution; IsPrimary = primary; this.available_resolutions.AddRange(availableResolutions); + #pragma warning disable 612,618 this.bounds = bounds == Rectangle.Empty ? currentResolution.Bounds : bounds; + #pragma warning restore 612,618 this.Id = id; } diff --git a/Source/OpenTK/DisplayResolution.cs b/Source/OpenTK/DisplayResolution.cs index 02fd04fa..43419408 100644 --- a/Source/OpenTK/DisplayResolution.cs +++ b/Source/OpenTK/DisplayResolution.cs @@ -153,7 +153,9 @@ namespace OpenTK /// A System.String representing this DisplayResolution. public override string ToString() { + #pragma warning disable 612,618 return String.Format("{0}x{1}@{2}Hz", Bounds, bits_per_pixel, refresh_rate); + #pragma warning restore 612,618 } #endregion @@ -187,7 +189,9 @@ namespace OpenTK /// A System.Int32 that may serve as a hash code for this resolution. public override int GetHashCode() { + #pragma warning disable 612,618 return Bounds.GetHashCode() ^ bits_per_pixel ^ refresh_rate.GetHashCode(); + #pragma warning restore 612,618 } #endregion diff --git a/Source/OpenTK/GameWindow.cs b/Source/OpenTK/GameWindow.cs index 41029bc6..cfab2243 100644 --- a/Source/OpenTK/GameWindow.cs +++ b/Source/OpenTK/GameWindow.cs @@ -78,8 +78,12 @@ namespace OpenTK const double MaxFrequency = 500.0; // Frequency cap for Update/RenderFrame events readonly Stopwatch watch = new Stopwatch(); + + #pragma warning disable 612,618 readonly IJoystickDriver LegacyJoystick = Factory.Default.CreateLegacyJoystickDriver(); + #pragma warning restore 612,618 + IGraphicsContext glContext; @@ -595,6 +599,7 @@ namespace OpenTK /// /// Gets the primary Keyboard device, or null if no Keyboard exists. /// + [Obsolete("Use KeyDown, KeyUp and KeyPress events or OpenTK.Input.Keyboard instead.")] public KeyboardDevice Keyboard { get { return InputDriver.Keyboard.Count > 0 ? InputDriver.Keyboard[0] : null; } @@ -607,6 +612,7 @@ namespace OpenTK /// /// Gets the primary Mouse device, or null if no Mouse exists. /// + [Obsolete("Use MouseMove, MouseDown, MouseUp and MouseWheel events or OpenTK.Input.Mouse, instead.")] public MouseDevice Mouse { get { return InputDriver.Mouse.Count > 0 ? InputDriver.Mouse[0] : null; } diff --git a/Source/OpenTK/Graphics/ES11/ES11.cs b/Source/OpenTK/Graphics/ES11/ES11.cs index 68910d20..9903b97b 100644 --- a/Source/OpenTK/Graphics/ES11/ES11.cs +++ b/Source/OpenTK/Graphics/ES11/ES11.cs @@ -1447,6 +1447,18 @@ namespace OpenTK.Graphics.ES11 /// [Obsolete("Use ClearMask overload instead")] [AutoGenerated(Category = "VERSION_ES_CM_1_0", Version = "1.0", EntryPoint = "glClear")] + [CLSCompliant(false)] + public static void Clear(Int32 mask) { throw new NotImplementedException(); } + + /// [requires: v1.0] + /// Clear buffers to preset values + /// + /// + /// Bitwise OR of masks that indicate the buffers to be cleared. The three masks are ColorBufferBit, DepthBufferBit, and StencilBufferBit. + /// + [Obsolete("Use ClearMask overload instead")] + [AutoGenerated(Category = "VERSION_ES_CM_1_0", Version = "1.0", EntryPoint = "glClear")] + [CLSCompliant(false)] public static void Clear(UInt32 mask) { throw new NotImplementedException(); } /// [requires: v1.0] diff --git a/Source/OpenTK/Graphics/ES11/ES11Enums.cs b/Source/OpenTK/Graphics/ES11/ES11Enums.cs index 89398de7..bc5b5a9f 100644 --- a/Source/OpenTK/Graphics/ES11/ES11Enums.cs +++ b/Source/OpenTK/Graphics/ES11/ES11Enums.cs @@ -6123,6 +6123,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum Amdcompressed3Dctexture : int { /// @@ -6142,6 +6144,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum AmdCompressed3DcTexture : int { /// @@ -6157,6 +6160,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum AmdcompressedAtctexture : int { /// @@ -6180,6 +6185,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum AmdCompressedAtcTexture : int { /// @@ -7930,6 +7936,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum ExttextureFilterAnisotropic : int { /// @@ -7949,6 +7957,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum ExtTextureFilterAnisotropic : int { /// @@ -7964,6 +7973,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum ExttextureFormatBgra8888 : int { /// @@ -7979,6 +7990,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum ExtTextureFormatBgra8888 : int { /// @@ -10673,6 +10685,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum ImgreadFormat : int { /// @@ -10696,6 +10710,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum ImgReadFormat : int { /// @@ -10711,6 +10726,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum ImgtextureCompressionPvrtc : int { /// @@ -10738,6 +10755,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum ImgTextureCompressionPvrtc : int { /// @@ -10761,6 +10779,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum ImgtextureEnvEnhancedFixedFunction : int { /// @@ -10800,6 +10820,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum ImgTextureEnvEnhancedFixedFunction : int { /// @@ -10835,6 +10856,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum ImguserClipPlane : int { /// @@ -10874,6 +10897,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum ImgUserClipPlane : int { /// @@ -12031,6 +12055,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum Nvfence : int { /// @@ -12054,6 +12080,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum NvFence : int { /// @@ -12101,6 +12128,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OesblendEquationSeparate : int { /// @@ -12120,6 +12149,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesBlendEquationSeparate : int { /// @@ -12135,6 +12165,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OesblendFuncSeparate : int { /// @@ -12162,6 +12194,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesBlendFuncSeparate : int { /// @@ -12185,6 +12218,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OesblendSubtract : int { /// @@ -12212,6 +12247,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesBlendSubtract : int { /// @@ -12235,6 +12271,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OesbyteCoordinates : int { /// @@ -12246,6 +12284,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesByteCoordinates : int { /// @@ -12257,6 +12296,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OescompressedEtc1Rgb8Texture : int { /// @@ -12272,6 +12313,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesCompressedEtc1Rgb8Texture : int { /// @@ -12283,6 +12325,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OescompressedPalettedTexture : int { /// @@ -12334,6 +12378,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesCompressedPalettedTexture : int { /// @@ -12381,6 +12426,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum Oesdepth24 : int { /// @@ -12396,6 +12443,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesDepth24 : int { /// @@ -12407,6 +12455,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum Oesdepth32 : int { /// @@ -12422,6 +12472,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesDepth32 : int { /// @@ -12433,6 +12484,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OesdrawTexture : int { /// @@ -12448,6 +12501,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesDrawTexture : int { /// @@ -12459,6 +12513,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum Oeseglimage : int { /// @@ -12470,6 +12526,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesEglImage : int { } @@ -12500,6 +12557,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OeselementIndexUint : int { /// @@ -12511,6 +12570,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesElementIndexUint : int { /// @@ -12522,6 +12582,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OesextendedMatrixPalette : int { /// @@ -12533,6 +12595,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesExtendedMatrixPalette : int { } @@ -12540,6 +12603,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OesfboRenderMipmap : int { /// @@ -12551,6 +12616,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesFboRenderMipmap : int { } @@ -12558,6 +12624,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OesfixedPoint : int { /// @@ -12573,6 +12641,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesFixedPoint : int { /// @@ -12584,6 +12653,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OesframebufferObject : int { /// @@ -12727,6 +12798,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesFramebufferObject : int { /// @@ -12866,6 +12938,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum Oesmapbuffer : int { /// @@ -12893,6 +12967,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesMapbuffer : int { /// @@ -12916,6 +12991,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OesmatrixGet : int { /// @@ -12939,6 +13016,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesMatrixGet : int { /// @@ -12958,6 +13036,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OesmatrixPalette : int { /// @@ -13033,6 +13113,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesMatrixPalette : int { /// @@ -13104,6 +13185,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OespackedDepthStencil : int { /// @@ -13127,6 +13210,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesPackedDepthStencil : int { /// @@ -13146,6 +13230,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OespointSizeArray : int { /// @@ -13177,6 +13263,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesPointSizeArray : int { /// @@ -13204,6 +13291,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OespointSprite : int { /// @@ -13223,6 +13312,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesPointSprite : int { /// @@ -13238,6 +13328,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OesqueryMatrix : int { /// @@ -13249,6 +13341,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesQueryMatrix : int { } @@ -13256,6 +13349,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OesreadFormat : int { /// @@ -13275,6 +13370,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesReadFormat : int { /// @@ -13357,6 +13453,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum Oesrgb8Rgba8 : int { /// @@ -13376,6 +13474,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesRgb8Rgba8 : int { /// @@ -13391,6 +13490,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OessinglePrecision : int { /// @@ -13402,6 +13503,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesSinglePrecision : int { } @@ -13409,6 +13511,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum Oesstencil1 : int { /// @@ -13424,6 +13528,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesStencil1 : int { /// @@ -13435,6 +13540,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum Oesstencil4 : int { /// @@ -13450,6 +13557,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesStencil4 : int { /// @@ -13461,6 +13569,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum Oesstencil8 : int { /// @@ -13476,6 +13586,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesStencil8 : int { /// @@ -13487,6 +13598,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OesstencilWrap : int { /// @@ -13506,6 +13619,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesStencilWrap : int { /// @@ -13521,6 +13635,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OestextureCubeMap : int { /// @@ -13584,6 +13700,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesTextureCubeMap : int { /// @@ -13643,6 +13760,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OestextureEnvCrossbar : int { /// @@ -13654,6 +13773,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesTextureEnvCrossbar : int { } @@ -13661,6 +13781,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum OestextureMirroredRepeat : int { /// @@ -13676,6 +13798,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum OesTextureMirroredRepeat : int { /// @@ -13698,6 +13821,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] public enum OpenGlescoreVersions : int { /// @@ -14608,6 +14732,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum QcomdriverControl : int { /// @@ -14619,6 +14745,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum QcomDriverControl : int { } @@ -14684,6 +14811,8 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] + [CLSCompliant(false)] public enum QcomperfmonGlobalMode : int { /// @@ -14699,6 +14828,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [CLSCompliant(false)] public enum QcomPerfmonGlobalMode : int { /// @@ -15139,6 +15269,7 @@ namespace OpenTK.Graphics.ES11 /// /// Not used directly. /// + [Obsolete("Use enum with correct capitalisation instead.")] public enum TextureCombineDot3 : int { /// diff --git a/Source/OpenTK/Graphics/ES20/Helper.cs b/Source/OpenTK/Graphics/ES20/Helper.cs index 1307d55d..cf0556be 100644 --- a/Source/OpenTK/Graphics/ES20/Helper.cs +++ b/Source/OpenTK/Graphics/ES20/Helper.cs @@ -458,15 +458,41 @@ namespace OpenTK.Graphics.ES20 #endregion } + #pragma warning disable 1574 // XML comment cref attribute could not be resolved, compiler bug in Mono 3.4.0 + + /// + /// Defines the signature of a debug callback for + /// . + /// + /// The for this debug message. + /// The for this debug message. + /// The id of this debug message. + /// The for this debug message. + /// The length of this debug message. + /// A pointer to a null-terminated ASCII C string, representing the content of this debug message. + /// A pointer to a user-specified parameter. [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProc( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr userParam); + /// + /// Defines the signature of a debug callback for + /// . + /// + /// The for this debug message. + /// The for this debug message. + /// The id of this debug message. + /// The for this debug message. + /// The length of this debug message. + /// A pointer to a null-terminated ASCII C string, representing the content of this debug message. + /// A pointer to a user-specified parameter. [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProcKhr( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr userParam); + + #pragma warning restore 1574 // XML comment cref attribute could not be resolved, compiler bug in Mono 3.4.0 } diff --git a/Source/OpenTK/Graphics/ES30/Helper.cs b/Source/OpenTK/Graphics/ES30/Helper.cs index 7fda7c64..9a289b84 100644 --- a/Source/OpenTK/Graphics/ES30/Helper.cs +++ b/Source/OpenTK/Graphics/ES30/Helper.cs @@ -449,15 +449,41 @@ namespace OpenTK.Graphics.ES30 #endregion } + #pragma warning disable 1574 // XML comment cref attribute could not be resolved, compiler bug in Mono 3.4.0 + + /// + /// Defines the signature of a debug callback for + /// . + /// + /// The for this debug message. + /// The for this debug message. + /// The id of this debug message. + /// The for this debug message. + /// The length of this debug message. + /// A pointer to a null-terminated ASCII C string, representing the content of this debug message. + /// A pointer to a user-specified parameter. [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProc( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr userParam); + /// + /// Defines the signature of a debug callback for + /// . + /// + /// The for this debug message. + /// The for this debug message. + /// The id of this debug message. + /// The for this debug message. + /// The length of this debug message. + /// A pointer to a null-terminated ASCII C string, representing the content of this debug message. + /// A pointer to a user-specified parameter. [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProcKhr( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr userParam); + + #pragma warning restore 1574 // XML comment cref attribute could not be resolved, compiler bug in Mono 3.4.0 } diff --git a/Source/OpenTK/Graphics/GraphicsContext.cs b/Source/OpenTK/Graphics/GraphicsContext.cs index 348b7950..1d6eb6bd 100644 --- a/Source/OpenTK/Graphics/GraphicsContext.cs +++ b/Source/OpenTK/Graphics/GraphicsContext.cs @@ -121,7 +121,7 @@ namespace OpenTK.Graphics Debug.Print("GraphicsContextFlags: {0}", flags); Debug.Print("Requested version: {0}.{1}", major, minor); - IGraphicsContext shareContext = shareContext = FindSharedContext(); + IGraphicsContext shareContext = FindSharedContext(); // Todo: Add a DummyFactory implementing IPlatformFactory. if (designMode) diff --git a/Source/OpenTK/Graphics/OpenGL/GL.cs b/Source/OpenTK/Graphics/OpenGL/GL.cs index b0b551ca..4207f38a 100644 --- a/Source/OpenTK/Graphics/OpenGL/GL.cs +++ b/Source/OpenTK/Graphics/OpenGL/GL.cs @@ -33908,8 +33908,9 @@ namespace OpenTK.Graphics.OpenGL /// /// Specifies a bitwise combination of flags controlling the behavior of the sync object. No flags are presently defined for this operation and flags must be zero.flags is a placeholder for anticipated future extensions of fence sync object capabilities. /// - [Obsolete("Use uint overload instead")] + [Obsolete("Use SyncCondition overload instead")] [AutoGenerated(Category = "ARB_sync|VERSION_3_2", Version = "3.2", EntryPoint = "glFenceSync")] + [CLSCompliant(false)] public static IntPtr FenceSync(OpenTK.Graphics.OpenGL.ArbSync condition, Int32 flags) { throw new NotImplementedException(); } /// [requires: v3.2 or ARB_sync|VERSION_3_2] @@ -33923,6 +33924,7 @@ namespace OpenTK.Graphics.OpenGL /// [Obsolete("Use SyncCondition overload instead")] [AutoGenerated(Category = "ARB_sync|VERSION_3_2", Version = "3.2", EntryPoint = "glFenceSync")] + [CLSCompliant(false)] public static IntPtr FenceSync(OpenTK.Graphics.OpenGL.ArbSync condition, UInt32 flags) { throw new NotImplementedException(); } /// [requires: v3.2 or ARB_sync|VERSION_3_2] @@ -119903,6 +119905,7 @@ namespace OpenTK.Graphics.OpenGL /// [Obsolete("Use FfdMaskSgix overload instead")] [AutoGenerated(Category = "SGIX_polynomial_ffd", Version = "", EntryPoint = "glDeformSGIX")] + [CLSCompliant(false)] public static void Deform(UInt32 mask) { throw new NotImplementedException(); } /// [requires: SGIX_async] @@ -120581,6 +120584,7 @@ namespace OpenTK.Graphics.OpenGL /// [Obsolete("Use FfdMaskSgix overload instead")] [AutoGenerated(Category = "SGIX_polynomial_ffd", Version = "", EntryPoint = "glLoadIdentityDeformationMapSGIX")] + [CLSCompliant(false)] public static void LoadIdentityDeformationMap(UInt32 mask) { throw new NotImplementedException(); } /// [requires: SGIX_pixel_texture] diff --git a/Source/OpenTK/Graphics/OpenGL/GLHelper.cs b/Source/OpenTK/Graphics/OpenGL/GLHelper.cs index 120bc3a7..db3815c3 100644 --- a/Source/OpenTK/Graphics/OpenGL/GLHelper.cs +++ b/Source/OpenTK/Graphics/OpenGL/GLHelper.cs @@ -1355,26 +1355,73 @@ namespace OpenTK.Graphics.OpenGL #endregion } + #pragma warning disable 1574 // XML comment cref attribute could not be resolved, compiler bug in Mono 3.4.0 + + /// + /// Defines the signature of a debug callback for + /// . + /// + /// The id of this debug message. + /// The category for this debug message. + /// The severity for this debug message. + /// The length of this debug message. + /// A pointer to a null-terminated ASCII C string, representing the content of this debug message. + /// A pointer to a user-specified parameter. [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProcAmd(int id, AmdDebugOutput category, AmdDebugOutput severity, int length, IntPtr message, IntPtr userParam); + /// + /// Defines the signature of a debug callback for + /// . + /// + /// The for this debug message. + /// The for this debug message. + /// The id of this debug message. + /// The for this debug message. + /// The length of this debug message. + /// A pointer to a null-terminated ASCII C string, representing the content of this debug message. + /// A pointer to a user-specified parameter. [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProcArb( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr userParam); + /// + /// Defines the signature of a debug callback for + /// . + /// + /// The for this debug message. + /// The for this debug message. + /// The id of this debug message. + /// The for this debug message. + /// The length of this debug message. + /// A pointer to a null-terminated ASCII C string, representing the content of this debug message. + /// A pointer to a user-specified parameter. [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProc( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr userParam); + /// + /// Defines the signature of a debug callback for + /// . + /// + /// The for this debug message. + /// The for this debug message. + /// The id of this debug message. + /// The for this debug message. + /// The length of this debug message. + /// A pointer to a null-terminated ASCII C string, representing the content of this debug message. + /// A pointer to a user-specified parameter. [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProcKhr( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr userParam); + + #pragma warning restore 1574 // XML comment cref attribute could not be resolved, compiler bug in Mono 3.4.0 } diff --git a/Source/OpenTK/Graphics/OpenGL4/Helper.cs b/Source/OpenTK/Graphics/OpenGL4/Helper.cs index d8da0b54..bb2c2540 100644 --- a/Source/OpenTK/Graphics/OpenGL4/Helper.cs +++ b/Source/OpenTK/Graphics/OpenGL4/Helper.cs @@ -458,21 +458,58 @@ namespace OpenTK.Graphics.OpenGL4 #endregion } - [UnmanagedFunctionPointer(CallingConvention.Winapi)] - public delegate void DebugProc( - DebugSource source, DebugType type, int id, - DebugSeverity severity, int length, IntPtr message, - IntPtr userParam); + #pragma warning disable 1574 // XML comment cref attribute could not be resolved, compiler bug in Mono 3.4.0 + /// + /// Defines the signature of a debug callback for + /// . + /// + /// The for this debug message. + /// The for this debug message. + /// The id of this debug message. + /// The for this debug message. + /// The length of this debug message. + /// A pointer to a null-terminated ASCII C string, representing the content of this debug message. + /// A pointer to a user-specified parameter. [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProcArb( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr userParam); + /// + /// Defines the signature of a debug callback for + /// . + /// + /// The for this debug message. + /// The for this debug message. + /// The id of this debug message. + /// The for this debug message. + /// The length of this debug message. + /// A pointer to a null-terminated ASCII C string, representing the content of this debug message. + /// A pointer to a user-specified parameter. + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + public delegate void DebugProc( + DebugSource source, DebugType type, int id, + DebugSeverity severity, int length, IntPtr message, + IntPtr userParam); + + /// + /// Defines the signature of a debug callback for + /// . + /// + /// The for this debug message. + /// The for this debug message. + /// The id of this debug message. + /// The for this debug message. + /// The length of this debug message. + /// A pointer to a null-terminated ASCII C string, representing the content of this debug message. + /// A pointer to a user-specified parameter. [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProcKhr( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr userParam); + + #pragma warning restore 1574 // XML comment cref attribute could not be resolved, compiler bug in Mono 3.4.0 } diff --git a/Source/OpenTK/INativeWindow.cs b/Source/OpenTK/INativeWindow.cs index 631cda9d..4535c60e 100644 --- a/Source/OpenTK/INativeWindow.cs +++ b/Source/OpenTK/INativeWindow.cs @@ -261,12 +261,12 @@ namespace OpenTK event EventHandler MouseEnter; /// - /// Occurs whenever a is clicked. + /// Occurs whenever a is clicked. /// event EventHandler MouseDown; /// - /// Occurs whenever a is released. + /// Occurs whenever a is released. /// event EventHandler MouseUp; diff --git a/Source/OpenTK/Input/IInputDriver.cs b/Source/OpenTK/Input/IInputDriver.cs index 594c1b31..c5b320b5 100644 --- a/Source/OpenTK/Input/IInputDriver.cs +++ b/Source/OpenTK/Input/IInputDriver.cs @@ -13,6 +13,7 @@ namespace OpenTK.Input /// /// Defines the interface for an input driver. /// + [Obsolete("This interface has been replaced by OpenTK.Input.Keyboard, Mouse, Joystick and GamePad.")] public interface IInputDriver : IKeyboardDriver, IMouseDriver, IJoystickDriver, IDisposable { /// diff --git a/Source/OpenTK/Input/Mouse.cs b/Source/OpenTK/Input/Mouse.cs index 6caeb835..132b0590 100644 --- a/Source/OpenTK/Input/Mouse.cs +++ b/Source/OpenTK/Input/Mouse.cs @@ -53,7 +53,7 @@ namespace OpenTK.Input /// typically between 200 and 2000 DPI. /// Use to retrieve the state of a specific mouse device. /// Use to retrieve the absolute coordinates of the mouse cursor. - /// Use for event-based mouse input. + /// Use for event-based mouse input. /// /// A structure representing the combined state of all mouse devices. public static MouseState GetState() @@ -71,7 +71,7 @@ namespace OpenTK.Input /// typically between 200 and 2000 DPI. /// Use to retrieve the combined state of all mouse devices. /// Use to retrieve the absolute coordinates of the mouse cursor. - /// Use for event-based mouse input. + /// Use for event-based mouse input. /// /// The index of the mouse device. /// A structure representing the state for the specified mouse device. diff --git a/Source/OpenTK/Input/MouseEventArgs.cs b/Source/OpenTK/Input/MouseEventArgs.cs index f9c6feb7..a5829e9b 100644 --- a/Source/OpenTK/Input/MouseEventArgs.cs +++ b/Source/OpenTK/Input/MouseEventArgs.cs @@ -231,7 +231,6 @@ namespace OpenTK.Input #region Fields MouseButton button; - bool pressed; #endregion @@ -253,7 +252,6 @@ namespace OpenTK.Input : base(x, y) { this.button = button; - this.pressed = pressed; } /// diff --git a/Source/OpenTK/Math/Quaternion.cs b/Source/OpenTK/Math/Quaternion.cs index 1334ea09..922a4f79 100644 --- a/Source/OpenTK/Math/Quaternion.cs +++ b/Source/OpenTK/Math/Quaternion.cs @@ -73,6 +73,8 @@ namespace OpenTK #region Properties + #pragma warning disable 3005 // Identifier differing only in case is not CLS-compliant, compiler bug in Mono 3.4.0 + /// /// Gets or sets an OpenTK.Vector3 with the X, Y and Z components of this instance. /// @@ -88,6 +90,8 @@ namespace OpenTK [CLSCompliant(false)] public Vector3 Xyz { get { return xyz; } set { xyz = value; } } + #pragma warning restore 3005 + /// /// Gets or sets the X component of this instance. /// diff --git a/Source/OpenTK/Math/Quaterniond.cs b/Source/OpenTK/Math/Quaterniond.cs index 9806f694..792dddde 100644 --- a/Source/OpenTK/Math/Quaterniond.cs +++ b/Source/OpenTK/Math/Quaterniond.cs @@ -73,6 +73,8 @@ namespace OpenTK #region Properties + #pragma warning disable 3005 // Identifier differing only in case is not CLS-compliant, compiler bug in Mono 3.4.0 + /// /// Gets or sets an OpenTK.Vector3d with the X, Y and Z components of this instance. /// @@ -87,6 +89,8 @@ namespace OpenTK /// public Vector3d Xyz { get { return xyz; } set { xyz = value; } } + #pragma warning restore 3005 + /// /// Gets or sets the X component of this instance. /// diff --git a/Source/OpenTK/Platform/Factory.cs b/Source/OpenTK/Platform/Factory.cs index 2bcfada5..a195429f 100644 --- a/Source/OpenTK/Platform/Factory.cs +++ b/Source/OpenTK/Platform/Factory.cs @@ -152,9 +152,12 @@ namespace OpenTK.Platform return default_implementation.CreateJoystickDriver(); } + [Obsolete] public IJoystickDriver CreateLegacyJoystickDriver() { + #pragma warning disable 612,618 return default_implementation.CreateLegacyJoystickDriver(); + #pragma warning restore 612,618 } class UnsupportedPlatform : PlatformFactoryBase diff --git a/Source/OpenTK/Platform/IPlatformFactory.cs b/Source/OpenTK/Platform/IPlatformFactory.cs index f9ec7066..34effb7f 100644 --- a/Source/OpenTK/Platform/IPlatformFactory.cs +++ b/Source/OpenTK/Platform/IPlatformFactory.cs @@ -53,6 +53,7 @@ namespace OpenTK.Platform Input.IJoystickDriver2 CreateJoystickDriver(); + [Obsolete] Input.IJoystickDriver CreateLegacyJoystickDriver(); } } diff --git a/Source/OpenTK/Platform/LegacyInputDriver.cs b/Source/OpenTK/Platform/LegacyInputDriver.cs index e2ee530d..4d5bc4b7 100644 --- a/Source/OpenTK/Platform/LegacyInputDriver.cs +++ b/Source/OpenTK/Platform/LegacyInputDriver.cs @@ -35,6 +35,7 @@ namespace OpenTK.Platform { // IInputDriver implementation to satisfy INativeWindow // while reducing code duplication. + [Obsolete] class LegacyInputDriver : IInputDriver { List dummy_keyboard_list = new List(1); diff --git a/Source/OpenTK/Platform/LegacyJoystickDriver.cs b/Source/OpenTK/Platform/LegacyJoystickDriver.cs index b58c21f2..202b9988 100644 --- a/Source/OpenTK/Platform/LegacyJoystickDriver.cs +++ b/Source/OpenTK/Platform/LegacyJoystickDriver.cs @@ -33,6 +33,7 @@ using OpenTK.Input; namespace OpenTK.Platform { + [Obsolete] internal class LegacyJoystickDriver : IJoystickDriver { static readonly string ConnectedName = "Connected Joystick"; diff --git a/Source/OpenTK/Platform/Linux/Bindings/Drm.cs b/Source/OpenTK/Platform/Linux/Bindings/Drm.cs index 583dd449..dbfa8aa5 100644 --- a/Source/OpenTK/Platform/Linux/Bindings/Drm.cs +++ b/Source/OpenTK/Platform/Linux/Bindings/Drm.cs @@ -30,6 +30,8 @@ using System; using System.Runtime.InteropServices; +#pragma warning disable 0649 // field is never assigned + namespace OpenTK.Platform.Linux { [UnmanagedFunctionPointer(CallingConvention.Cdecl)] diff --git a/Source/OpenTK/Platform/Linux/Bindings/Libc.cs b/Source/OpenTK/Platform/Linux/Bindings/Libc.cs index db026a77..4b29624f 100644 --- a/Source/OpenTK/Platform/Linux/Bindings/Libc.cs +++ b/Source/OpenTK/Platform/Linux/Bindings/Libc.cs @@ -31,6 +31,8 @@ using System; using System.Runtime.InteropServices; using System.Text; +#pragma warning disable 0649 // field is never assigned + namespace OpenTK.Platform.Linux { partial class Libc diff --git a/Source/OpenTK/Platform/Linux/LinuxNativeWindow.cs b/Source/OpenTK/Platform/Linux/LinuxNativeWindow.cs index 961381ee..db8ebd1c 100644 --- a/Source/OpenTK/Platform/Linux/LinuxNativeWindow.cs +++ b/Source/OpenTK/Platform/Linux/LinuxNativeWindow.cs @@ -58,8 +58,6 @@ namespace OpenTK.Platform.Linux BufferObject cursor_default; BufferObject cursor_empty; - IntPtr gbm_surface; - public LinuxNativeWindow(IntPtr display, IntPtr gbm, int fd, int x, int y, int width, int height, string title, GraphicsMode mode, GameWindowFlags options, diff --git a/Source/OpenTK/Platform/MacOS/Cocoa/NSApplication.cs b/Source/OpenTK/Platform/MacOS/Cocoa/NSApplication.cs index 30e61ce6..0670d43c 100644 --- a/Source/OpenTK/Platform/MacOS/Cocoa/NSApplication.cs +++ b/Source/OpenTK/Platform/MacOS/Cocoa/NSApplication.cs @@ -83,7 +83,7 @@ namespace OpenTK.Platform.MacOS // Disable momentum scrolling and long-press key pop-ups IntPtr settings = Cocoa.SendIntPtr(Class.NSDictionary, Selector.Alloc); - IntPtr momentum_scrolling = Cocoa.SendIntPtr(Class.NSNumber, Selector.Get("numberWithBool:"), false); + //IntPtr momentum_scrolling = Cocoa.SendIntPtr(Class.NSNumber, Selector.Get("numberWithBool:"), false); IntPtr press_and_hold = Cocoa.SendIntPtr(Class.NSNumber, Selector.Get("numberWithBool:"), false); // Initialize and register the settings dictionary diff --git a/Source/OpenTK/Platform/MacOS/CocoaNativeWindow.cs b/Source/OpenTK/Platform/MacOS/CocoaNativeWindow.cs index d187f1aa..834e0483 100644 --- a/Source/OpenTK/Platform/MacOS/CocoaNativeWindow.cs +++ b/Source/OpenTK/Platform/MacOS/CocoaNativeWindow.cs @@ -141,7 +141,6 @@ namespace OpenTK.Platform.MacOS private int normalLevel; private bool shouldClose; private int suppressResize; - private bool cursorInsideWindow = true; private MouseCursor selectedCursor = MouseCursor.Default; // user-selected cursor public CocoaNativeWindow(int x, int y, int width, int height, string title, GraphicsMode mode, GameWindowFlags options, DisplayDevice device) diff --git a/Source/OpenTK/Platform/MacOS/HIDInput.cs b/Source/OpenTK/Platform/MacOS/HIDInput.cs index 8f303040..5bde1be3 100755 --- a/Source/OpenTK/Platform/MacOS/HIDInput.cs +++ b/Source/OpenTK/Platform/MacOS/HIDInput.cs @@ -561,7 +561,6 @@ namespace OpenTK.Platform.MacOS for (int i = 0; i < element_array.Count; i++) { IOHIDElementRef element_ref = element_array[i]; - IOHIDElementType type = NativeMethods.IOHIDElementGetType(element_ref); HIDPage page = NativeMethods.IOHIDElementGetUsagePage(element_ref); int usage = NativeMethods.IOHIDElementGetUsage(element_ref); diff --git a/Source/OpenTK/Platform/NativeWindowBase.cs b/Source/OpenTK/Platform/NativeWindowBase.cs index 90e53a81..a6ba2c26 100644 --- a/Source/OpenTK/Platform/NativeWindowBase.cs +++ b/Source/OpenTK/Platform/NativeWindowBase.cs @@ -38,7 +38,9 @@ namespace OpenTK.Platform // Common base class for all INativeWindow implementations abstract class NativeWindowBase : INativeWindow { + #pragma warning disable 612,618 readonly LegacyInputDriver LegacyInputDriver; + #pragma warning restore 612,618 readonly MouseButtonEventArgs MouseDownArgs = new MouseButtonEventArgs(); readonly MouseButtonEventArgs MouseUpArgs = new MouseButtonEventArgs(); @@ -58,7 +60,9 @@ namespace OpenTK.Platform internal NativeWindowBase() { + #pragma warning disable 612,618 LegacyInputDriver = new LegacyInputDriver(this); + #pragma warning restore 612,618 MouseState.SetIsConnected(true); KeyboardState.SetIsConnected(true); PreviousMouseState.SetIsConnected(true); @@ -445,6 +449,7 @@ namespace OpenTK.Platform public abstract Size ClientSize { get; set; } + [Obsolete] public virtual IInputDriver InputDriver { get diff --git a/Source/OpenTK/Platform/PlatformFactoryBase.cs b/Source/OpenTK/Platform/PlatformFactoryBase.cs index aa518e2c..40dc0c1c 100644 --- a/Source/OpenTK/Platform/PlatformFactoryBase.cs +++ b/Source/OpenTK/Platform/PlatformFactoryBase.cs @@ -74,6 +74,7 @@ namespace OpenTK.Platform public abstract IJoystickDriver2 CreateJoystickDriver(); + [Obsolete] public virtual IJoystickDriver CreateLegacyJoystickDriver() { return new LegacyJoystickDriver(); diff --git a/Source/OpenTK/Platform/SDL2/Sdl2.cs b/Source/OpenTK/Platform/SDL2/Sdl2.cs index b1acdb7b..2a9bba15 100644 --- a/Source/OpenTK/Platform/SDL2/Sdl2.cs +++ b/Source/OpenTK/Platform/SDL2/Sdl2.cs @@ -31,6 +31,8 @@ using System.Diagnostics; using System.Security; using System.Runtime.InteropServices; +#pragma warning disable 0169 + namespace OpenTK.Platform.SDL2 { using Surface = IntPtr; diff --git a/Source/OpenTK/Platform/SDL2/Sdl2JoystickDriver.cs b/Source/OpenTK/Platform/SDL2/Sdl2JoystickDriver.cs index 71ab3eea..41726c62 100644 --- a/Source/OpenTK/Platform/SDL2/Sdl2JoystickDriver.cs +++ b/Source/OpenTK/Platform/SDL2/Sdl2JoystickDriver.cs @@ -32,7 +32,7 @@ using OpenTK.Input; namespace OpenTK.Platform.SDL2 { - class Sdl2JoystickDriver : IJoystickDriver, IJoystickDriver2, IGamePadDriver, IDisposable + class Sdl2JoystickDriver : IJoystickDriver2, IGamePadDriver, IDisposable { const float RangeMultiplier = 1.0f / 32768.0f; readonly MappedGamePadDriver gamepad_driver = new MappedGamePadDriver(); @@ -55,9 +55,6 @@ namespace OpenTK.Platform.SDL2 readonly List joysticks = new List(4); readonly Dictionary sdl_instanceid_to_joysticks = new Dictionary(); - // For IJoystickDriver implementation - IList joysticks_readonly; - #if USE_SDL2_GAMECONTROLLER class Sdl2GamePad { @@ -78,7 +75,6 @@ namespace OpenTK.Platform.SDL2 public Sdl2JoystickDriver() { - joysticks_readonly = joysticks.AsReadOnly(); } #region Private Members @@ -548,23 +544,6 @@ namespace OpenTK.Platform.SDL2 #endregion - #region IJoystickDriver Members - - public IList Joysticks - { - get - { - return joysticks_readonly; - } - } - - public void Poll() - { - // Do nothing - } - - #endregion - #region IGamePadDriver Members #if USE_SDL2_GAMECONTOLLER diff --git a/Source/OpenTK/Platform/SDL2/Sdl2Keyboard.cs b/Source/OpenTK/Platform/SDL2/Sdl2Keyboard.cs index d58c5f73..d5b05c1f 100644 --- a/Source/OpenTK/Platform/SDL2/Sdl2Keyboard.cs +++ b/Source/OpenTK/Platform/SDL2/Sdl2Keyboard.cs @@ -33,11 +33,9 @@ namespace OpenTK.Platform.SDL2 { class Sdl2Keyboard : IKeyboardDriver2 { + #pragma warning disable 649 // Field never assigned to, compiler bug in Mono 3.4.0 KeyboardState state; - - readonly List keyboards = - new List(); - readonly IList keyboards_readonly; + #pragma warning restore 649 public Sdl2Keyboard() { @@ -79,7 +77,6 @@ namespace OpenTK.Platform.SDL2 bool pressed = e.State != 0; var scancode = e.Keysym.Scancode; Key key = Sdl2KeyMap.GetKey(scancode); - KeyModifiers mods = Sdl2KeyMap.GetModifiers(e.Keysym.Mod); if (key != Key.Unknown) { diff --git a/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs b/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs index 0e576e90..e024abd5 100644 --- a/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs +++ b/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs @@ -60,7 +60,6 @@ namespace OpenTK.Platform.SDL2 Icon icon; MouseCursor cursor = MouseCursor.Default; IntPtr sdl_cursor = IntPtr.Zero; - string window_title; // Used in KeyPress event to decode SDL UTF8 text strings // to .Net UTF16 strings @@ -100,7 +99,6 @@ namespace OpenTK.Platform.SDL2 window = new Sdl2WindowInfo(handle, null); window_id = SDL.GetWindowID(handle); windows.Add(window_id, this); - window_title = title; } } @@ -669,7 +667,6 @@ namespace OpenTK.Platform.SDL2 if (Exists) { SDL.SetWindowTitle(window.Handle, value); - window_title = value; } } } @@ -943,7 +940,7 @@ namespace OpenTK.Platform.SDL2 if (manual) { Debug.Print("Disposing {0}", GetType()); - InputDriver.Dispose(); + if (Exists) { DestroyWindow(); diff --git a/Source/OpenTK/Platform/Windows/API.cs b/Source/OpenTK/Platform/Windows/API.cs index 167dcb5c..d8fa2955 100644 --- a/Source/OpenTK/Platform/Windows/API.cs +++ b/Source/OpenTK/Platform/Windows/API.cs @@ -3141,6 +3141,9 @@ namespace OpenTK.Platform.Windows /// public IntPtr ExtraInfo; + /// + /// Returns the size of a MouseMovePoint in bytes. + /// public static readonly int SizeInBytes = Marshal.SizeOf(default(MouseMovePoint)); } diff --git a/Source/OpenTK/Platform/Windows/WinDisplayDevice.cs b/Source/OpenTK/Platform/Windows/WinDisplayDevice.cs index fc594b63..ceb7cd42 100644 --- a/Source/OpenTK/Platform/Windows/WinDisplayDevice.cs +++ b/Source/OpenTK/Platform/Windows/WinDisplayDevice.cs @@ -113,7 +113,7 @@ namespace OpenTK.Platform.Windows int device_count = 0, mode_count = 0; // Get available video adapters and enumerate all monitors - WindowsDisplayDevice dev1 = new WindowsDisplayDevice(), dev2 = new WindowsDisplayDevice(); + WindowsDisplayDevice dev1 = new WindowsDisplayDevice(); while (Functions.EnumDisplayDevices(null, device_count++, dev1, 0)) { if ((dev1.StateFlags & DisplayDeviceStateFlags.AttachedToDesktop) == DisplayDeviceStateFlags.None) @@ -156,12 +156,14 @@ namespace OpenTK.Platform.Windows // Construct the OpenTK DisplayDevice through the accumulated parameters. // The constructor will automatically add the DisplayDevice to the list // of available devices. + #pragma warning disable 612,618 opentk_dev = new DisplayDevice( opentk_dev_current_res, opentk_dev_primary, opentk_dev_available_res, opentk_dev_current_res.Bounds, dev1.DeviceName); + #pragma warning restore 612,618 // Set the original resolution if the DisplayDevice was previously available. foreach (DisplayDevice existingDevice in previousDevices) diff --git a/Source/OpenTK/Platform/Windows/WinGLNative.cs b/Source/OpenTK/Platform/Windows/WinGLNative.cs index fdcc14b4..eb348c89 100644 --- a/Source/OpenTK/Platform/Windows/WinGLNative.cs +++ b/Source/OpenTK/Platform/Windows/WinGLNative.cs @@ -444,7 +444,7 @@ namespace OpenTK.Platform.Windows else { // Exclude the current position. - Point currentScreenPosition = new Point(InputDriver.Mouse[0].X, InputDriver.Mouse[0].Y); + Point currentScreenPosition = new Point(MouseState.X, MouseState.Y); Functions.ClientToScreen(handle, ref currentScreenPosition); // Find the first move point we've already seen. @@ -867,7 +867,7 @@ namespace OpenTK.Platform.Windows wc.WndProc = WindowProcedureDelegate; wc.ClassName = ClassName; wc.Icon = Icon != null ? Icon.Handle : IntPtr.Zero; -#warning "This seems to resize one of the 'large' icons, rather than using a small icon directly (multi-icon files). Investigate!" + // Todo: the following line appears to resize one of the 'large' icons, rather than using a small icon directly (multi-icon files). Investigate! wc.IconSm = Icon != null ? new Icon(Icon, 16, 16).Handle : IntPtr.Zero; wc.Cursor = Functions.LoadCursor(CursorName.Arrow); ushort atom = Functions.RegisterClassEx(ref wc); diff --git a/Source/OpenTK/Platform/Windows/WinGraphicsMode.cs b/Source/OpenTK/Platform/Windows/WinGraphicsMode.cs index 8550ddf8..91ffd9ac 100644 --- a/Source/OpenTK/Platform/Windows/WinGraphicsMode.cs +++ b/Source/OpenTK/Platform/Windows/WinGraphicsMode.cs @@ -47,9 +47,7 @@ namespace OpenTK.Platform.Windows ICD, } - static readonly object SyncRoot = new object(); readonly IntPtr Device; - readonly List modes = new List(); #region Constructors diff --git a/Source/OpenTK/Platform/Windows/WinMMJoystick.cs b/Source/OpenTK/Platform/Windows/WinMMJoystick.cs index adcdf1df..ff3e6351 100644 --- a/Source/OpenTK/Platform/Windows/WinMMJoystick.cs +++ b/Source/OpenTK/Platform/Windows/WinMMJoystick.cs @@ -36,14 +36,13 @@ using OpenTK.Input; namespace OpenTK.Platform.Windows { - sealed class WinMMJoystick : IJoystickDriver, IJoystickDriver2 + sealed class WinMMJoystick : IJoystickDriver2 { #region Fields readonly object sync = new object(); List sticks = new List(); - IList sticks_readonly; // Matches a WinMM device index to a specific stick above readonly Dictionary index_to_stick = @@ -65,7 +64,6 @@ namespace OpenTK.Platform.Windows public WinMMJoystick() { - sticks_readonly = sticks.AsReadOnly(); RefreshDevices(); } @@ -228,111 +226,6 @@ namespace OpenTK.Platform.Windows #endregion - #region IJoystickDriver - - public int DeviceCount - { - get { return sticks.Count; } - } - - public IList Joysticks - { - get { return sticks_readonly; } - } - - public void Poll() - { - lock (sync) - { - foreach (JoystickDevice js in sticks) - { - JoyInfoEx info = new JoyInfoEx(); - info.Size = JoyInfoEx.SizeInBytes; - info.Flags = JoystickFlags.All; - UnsafeNativeMethods.joyGetPosEx(js.Id, ref info); - - int num_axes = js.Axis.Count; - if ((js.Details.PovType & PovType.Exists) != 0) - num_axes -= 2; // Because the last two axis are used for POV input. - - int axis = 0; - if (axis < num_axes) - { js.SetAxis((JoystickAxis)axis, js.Details.CalculateOffset((float)info.XPos, axis)); axis++; } - if (axis < num_axes) - { js.SetAxis((JoystickAxis)axis, js.Details.CalculateOffset((float)info.YPos, axis)); axis++; } - if (axis < num_axes) - { js.SetAxis((JoystickAxis)axis, js.Details.CalculateOffset((float)info.ZPos, axis)); axis++; } - if (axis < num_axes) - { js.SetAxis((JoystickAxis)axis, js.Details.CalculateOffset((float)info.RPos, axis)); axis++; } - if (axis < num_axes) - { js.SetAxis((JoystickAxis)axis, js.Details.CalculateOffset((float)info.UPos, axis)); axis++; } - if (axis < num_axes) - { js.SetAxis((JoystickAxis)axis, js.Details.CalculateOffset((float)info.VPos, axis)); axis++; } - - if ((js.Details.PovType & PovType.Exists) != 0) - { - float x = 0, y = 0; - - // A discrete POV returns specific values for left, right, etc. - // A continuous POV returns an integer indicating an angle in degrees * 100, e.g. 18000 == 180.00 degrees. - // The vast majority of joysticks have discrete POVs, so we'll treat all of them as discrete for simplicity. - if ((JoystickPovPosition)info.Pov != JoystickPovPosition.Centered) - { - if (info.Pov > (int)JoystickPovPosition.Left || info.Pov < (int)JoystickPovPosition.Right) - { y = 1; } - if ((info.Pov > (int)JoystickPovPosition.Forward) && (info.Pov < (int)JoystickPovPosition.Backward)) - { x = 1; } - if ((info.Pov > (int)JoystickPovPosition.Right) && (info.Pov < (int)JoystickPovPosition.Left)) - { y = -1; } - if (info.Pov > (int)JoystickPovPosition.Backward) - { x = -1; } - } - //if ((js.Details.PovType & PovType.Discrete) != 0) - //{ - // if ((JoystickPovPosition)info.Pov == JoystickPovPosition.Centered) - // { x = 0; y = 0; } - // else if ((JoystickPovPosition)info.Pov == JoystickPovPosition.Forward) - // { x = 0; y = -1; } - // else if ((JoystickPovPosition)info.Pov == JoystickPovPosition.Left) - // { x = -1; y = 0; } - // else if ((JoystickPovPosition)info.Pov == JoystickPovPosition.Backward) - // { x = 0; y = 1; } - // else if ((JoystickPovPosition)info.Pov == JoystickPovPosition.Right) - // { x = 1; y = 0; } - //} - //else if ((js.Details.PovType & PovType.Continuous) != 0) - //{ - // if ((JoystickPovPosition)info.Pov == JoystickPovPosition.Centered) - // { - // // This approach moves the hat on a circle, not a square as it should. - // float angle = (float)(System.Math.PI * info.Pov / 18000.0 + System.Math.PI / 2); - // x = (float)System.Math.Cos(angle); - // y = (float)System.Math.Sin(angle); - // if (x < 0.001) - // x = 0; - // if (y < 0.001) - // y = 0; - // } - //} - //else - // throw new NotImplementedException("Please post an issue report at http://www.opentk.com/issues"); - - js.SetAxis((JoystickAxis)axis++, x); - js.SetAxis((JoystickAxis)axis++, y); - } - - int button = 0; - while (button < js.Button.Count) - { - js.SetButton((JoystickButton)button, (info.Buttons & (1 << button)) != 0); - button++; - } - } - } - } - - #endregion - #region IJoystickDriver2 Members public JoystickCapabilities GetCapabilities(int player_index) diff --git a/Source/OpenTK/Platform/Windows/WinRawInput.cs b/Source/OpenTK/Platform/Windows/WinRawInput.cs index 9f12099f..0e99bc96 100644 --- a/Source/OpenTK/Platform/Windows/WinRawInput.cs +++ b/Source/OpenTK/Platform/Windows/WinRawInput.cs @@ -39,7 +39,6 @@ namespace OpenTK.Platform.Windows // Input event data. static RawInput data = new RawInput(); - static readonly int rawInputStructSize = API.RawInputSize; WinRawKeyboard keyboard_driver; WinRawMouse mouse_driver; diff --git a/Source/OpenTK/Platform/Windows/XInputJoystick.cs b/Source/OpenTK/Platform/Windows/XInputJoystick.cs index 910a7f01..ef38e087 100644 --- a/Source/OpenTK/Platform/Windows/XInputJoystick.cs +++ b/Source/OpenTK/Platform/Windows/XInputJoystick.cs @@ -237,6 +237,8 @@ namespace OpenTK.Platform.Windows Any = 0xff } +#pragma warning disable 0649 // field is never assigned + struct XInputThresholds { public const int LeftThumbDeadzone = 7849; diff --git a/Source/OpenTK/Platform/X11/Bindings/Xkb.cs b/Source/OpenTK/Platform/X11/Bindings/Xkb.cs index 0be69717..74a3d83b 100644 --- a/Source/OpenTK/Platform/X11/Bindings/Xkb.cs +++ b/Source/OpenTK/Platform/X11/Bindings/Xkb.cs @@ -31,6 +31,8 @@ using System; using System.Diagnostics; using System.Runtime.InteropServices; +#pragma warning disable 0169 + namespace OpenTK.Platform.X11 { using Atom = IntPtr; diff --git a/Source/OpenTK/Platform/X11/Functions.cs b/Source/OpenTK/Platform/X11/Functions.cs index b8e44ed1..985e6471 100644 --- a/Source/OpenTK/Platform/X11/Functions.cs +++ b/Source/OpenTK/Platform/X11/Functions.cs @@ -575,7 +575,6 @@ namespace OpenTK.Platform.X11 { int width = image.Width; int height = image.Height; - int size = width * height; BitmapData data = image.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadOnly, @@ -591,7 +590,7 @@ namespace OpenTK.Platform.X11 XFreeGC(display, gc); image.UnlockBits(data); - + return pixmap; } diff --git a/Source/OpenTK/Platform/X11/X11DisplayDevice.cs b/Source/OpenTK/Platform/X11/X11DisplayDevice.cs index 7f9e1ea3..3a794f1b 100644 --- a/Source/OpenTK/Platform/X11/X11DisplayDevice.cs +++ b/Source/OpenTK/Platform/X11/X11DisplayDevice.cs @@ -324,8 +324,6 @@ namespace OpenTK.Platform.X11 { short rate = 0; IntPtr screen_config = Functions.XRRGetScreenInfo(API.DefaultDisplay, Functions.XRootWindow(API.DefaultDisplay, screen)); - ushort rotation = 0; - int size = Functions.XRRConfigCurrentConfiguration(screen_config, out rotation); rate = Functions.XRRConfigCurrentRate(screen_config); Functions.XRRFreeScreenConfigInfo(screen_config); return (float)rate; diff --git a/Source/OpenTK/Platform/X11/X11GLNative.cs b/Source/OpenTK/Platform/X11/X11GLNative.cs index 388c45a5..b10a5b52 100644 --- a/Source/OpenTK/Platform/X11/X11GLNative.cs +++ b/Source/OpenTK/Platform/X11/X11GLNative.cs @@ -75,31 +75,27 @@ namespace OpenTK.Platform.X11 IntPtr _atom_net_wm_state_fullscreen; IntPtr _atom_net_wm_state_maximized_horizontal; IntPtr _atom_net_wm_state_maximized_vertical; - + + #pragma warning disable 414 // assigned but never used IntPtr _atom_net_wm_allowed_actions; IntPtr _atom_net_wm_action_resize; IntPtr _atom_net_wm_action_maximize_horizontally; IntPtr _atom_net_wm_action_maximize_vertically; + #pragma warning restore 414 IntPtr _atom_net_wm_icon; IntPtr _atom_net_frame_extents; - IntPtr _atom_wm_class; - readonly IntPtr _atom_xa_cardinal = new IntPtr(6); - - //IntPtr _atom_motif_wm_hints; - //IntPtr _atom_kde_wm_hints; - //IntPtr _atom_kde_net_wm_hints; static readonly IntPtr _atom_remove = (IntPtr)0; static readonly IntPtr _atom_add = (IntPtr)1; static readonly IntPtr _atom_toggle = (IntPtr)2; - // Used by OpenTK to detect mouse warp events - + #pragma warning disable 649 // never assigned, compiler bug in Mono 3.4.0 Rectangle bounds, client_rectangle; + #pragma warning restore 649 int border_left, border_right, border_top, border_bottom; Icon icon; bool has_focus; @@ -131,9 +127,11 @@ namespace OpenTK.Platform.X11 readonly IntPtr EmptyCursor; + #pragma warning disable 414 // Field assigned but never used, we do that on purpose readonly bool xi2_supported; readonly int xi2_opcode; readonly int xi2_version; + #pragma warning restore 414 #endregion @@ -148,10 +146,8 @@ namespace OpenTK.Platform.X11 if (height <= 0) throw new ArgumentOutOfRangeException("height", "Must be higher than zero."); - XVisualInfo info = new XVisualInfo(); - Debug.Indent(); - + using (new XLock(window.Display)) { IntPtr visual; @@ -419,15 +415,7 @@ namespace OpenTK.Platform.X11 bool IsWindowBorderHidden { get - { - //IntPtr actual_atom; - //int actual_format; - //IntPtr nitems; - //IntPtr bytes_after; - IntPtr prop = IntPtr.Zero; - //IntPtr atom; - //XWindowAttributes attributes; - + { using (new XLock(window.Display)) { // Test if decorations have been disabled through Motif. diff --git a/Source/OpenTK/Platform/X11/X11GraphicsMode.cs b/Source/OpenTK/Platform/X11/X11GraphicsMode.cs index 9a76447e..d82e6162 100644 --- a/Source/OpenTK/Platform/X11/X11GraphicsMode.cs +++ b/Source/OpenTK/Platform/X11/X11GraphicsMode.cs @@ -102,7 +102,6 @@ namespace OpenTK.Platform.X11 Debug.Print("Selecting FB config for {0}", mode); List visualAttributes = new List(); - IntPtr visual = IntPtr.Zero; if (mode.ColorFormat.BitsPerPixel > 0) {