From 573622bf0bc1319ee6a6c5fcd45acb2c7e1e3f47 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Fri, 19 Sep 2008 20:57:35 +0000 Subject: [PATCH] Removed unused variables and relevant warnings. --- Source/Examples/OpenAL/StreamingPlayback.cs | 2 +- Source/Examples/Tests/MathSpeed.cs | 17 +++++++++-------- Source/Examples/Tutorial/Fonts.cs | 7 ++++--- Source/Examples/Tutorial/T02_Vertex_Arrays.cs | 4 ++-- Source/Examples/Tutorial/T08_VBO.cs | 2 +- Source/Examples/WinForms/DerivedGLControl.cs | 7 ++++++- Source/Examples/WinForms/W03_Extensions.cs | 4 ++-- Source/OpenTK/Platform/Windows/API.cs | 8 ++++++-- 8 files changed, 31 insertions(+), 20 deletions(-) diff --git a/Source/Examples/OpenAL/StreamingPlayback.cs b/Source/Examples/OpenAL/StreamingPlayback.cs index 2e82cc1e..75c9c0ba 100644 --- a/Source/Examples/OpenAL/StreamingPlayback.cs +++ b/Source/Examples/OpenAL/StreamingPlayback.cs @@ -25,7 +25,7 @@ namespace Examples.OpenAL const int buffer_size = (int)(0.5*44100); const int buffer_count = 4; - static object openal_lock = new object(); // Should be global in your app. + //static object openal_lock = new object(); // Should be global in your app. public static void Main() { diff --git a/Source/Examples/Tests/MathSpeed.cs b/Source/Examples/Tests/MathSpeed.cs index 7d7da843..d4017abc 100644 --- a/Source/Examples/Tests/MathSpeed.cs +++ b/Source/Examples/Tests/MathSpeed.cs @@ -16,7 +16,8 @@ namespace Examples.Tests public class MathSpeed { public static void Main() - { + { + /* Stopwatch watch = new Stopwatch(); Vector3 a = new Vector3(0.0f, 0.0f, 0.0f); @@ -31,7 +32,7 @@ namespace Examples.Tests Vector3.Add(ref a, ref b, out res); res = a + b; res = Vector3.Zero; - /* + watch.Reset(); watch.Start(); for (int i = 100000000; --i != 0; ) @@ -82,12 +83,12 @@ namespace Examples.Tests */ } - static Vector3 pos = new Vector3(); + //static Vector3 pos = new Vector3(); - static Vector3 Pos - { - get { return pos; } - set { pos = value; } - } + //static Vector3 Pos + //{ + // get { return pos; } + // set { pos = value; } + //} } } diff --git a/Source/Examples/Tutorial/Fonts.cs b/Source/Examples/Tutorial/Fonts.cs index 3abfef2a..0113dd9c 100644 --- a/Source/Examples/Tutorial/Fonts.cs +++ b/Source/Examples/Tutorial/Fonts.cs @@ -175,10 +175,11 @@ namespace Examples.Tutorial } // Move to the right, and print using the second font. - float width, height; - fonts[handles.Length / 2 - 1].MeasureString(text, out width, out height); + //float width, height; + //fonts[handles.Length / 2 - 1].MeasureString(text, out width, out height); + RectangleF rect = fonts[handles.Length / 2 - 1].MeasureText(text); GL.LoadIdentity(); - GL.Translate(width + 32.0f, 0, 0); + GL.Translate(rect.Width + 32.0f, 0, 0); for (int i = handles.Length / 2; i < handles.Length; i++) { printer.Draw(handles[i]); diff --git a/Source/Examples/Tutorial/T02_Vertex_Arrays.cs b/Source/Examples/Tutorial/T02_Vertex_Arrays.cs index 59d3cde1..68ffe5af 100644 --- a/Source/Examples/Tutorial/T02_Vertex_Arrays.cs +++ b/Source/Examples/Tutorial/T02_Vertex_Arrays.cs @@ -30,8 +30,8 @@ namespace Examples.Tutorial float angle = 0.0f; Shapes.Shape shape = new Examples.Shapes.Plane(16, 16, 2.0f, 2.0f); - TextureFont sans = new TextureFont(new Font(FontFamily.GenericSansSerif, 32, FontStyle.Regular, - GraphicsUnit.Pixel)); + //TextureFont sans = new TextureFont(new Font(FontFamily.GenericSansSerif, 32, FontStyle.Regular, + // GraphicsUnit.Pixel)); #region Constructor diff --git a/Source/Examples/Tutorial/T08_VBO.cs b/Source/Examples/Tutorial/T08_VBO.cs index a7d6f353..beaf06c7 100644 --- a/Source/Examples/Tutorial/T08_VBO.cs +++ b/Source/Examples/Tutorial/T08_VBO.cs @@ -27,7 +27,7 @@ namespace Examples.Tutorial #region --- Private Fields --- Shapes.Shape cube = new Examples.Shapes.Cube(); - Shapes.Shape plane = new Examples.Shapes.Plane(16, 16, 2.0f, 2.0f); + //Shapes.Shape plane = new Examples.Shapes.Plane(16, 16, 2.0f, 2.0f); struct Vbo { diff --git a/Source/Examples/WinForms/DerivedGLControl.cs b/Source/Examples/WinForms/DerivedGLControl.cs index 399d0c2a..f9244fea 100644 --- a/Source/Examples/WinForms/DerivedGLControl.cs +++ b/Source/Examples/WinForms/DerivedGLControl.cs @@ -13,7 +13,12 @@ namespace Examples.WinForms { public partial class DerivedGLControl : GLControl { - Color clearColor; + Color clearColor; + + public DerivedGLControl() + { + this.InitializeComponent(); + } public Color ClearColor { diff --git a/Source/Examples/WinForms/W03_Extensions.cs b/Source/Examples/WinForms/W03_Extensions.cs index 10827e29..3180f473 100644 --- a/Source/Examples/WinForms/W03_Extensions.cs +++ b/Source/Examples/WinForms/W03_Extensions.cs @@ -27,7 +27,7 @@ namespace Examples.WinForms GLControl glControl = new GLControl(GraphicsMode.Default); Type glClass; Type delegatesClass; - Type importsClass; + //Type importsClass; int supported, all; // Number of supported extensions. string driver; @@ -37,7 +37,7 @@ namespace Examples.WinForms glClass = typeof(GL); delegatesClass = glClass.GetNestedType("Delegates", BindingFlags.Static | BindingFlags.NonPublic); - importsClass = glClass.GetNestedType("Imports", BindingFlags.Static | BindingFlags.NonPublic); + //importsClass = glClass.GetNestedType("Imports", BindingFlags.Static | BindingFlags.NonPublic); glControl.CreateControl(); Application.Idle += StartAsync; diff --git a/Source/OpenTK/Platform/Windows/API.cs b/Source/OpenTK/Platform/Windows/API.cs index b3bd58ec..d55282d0 100644 --- a/Source/OpenTK/Platform/Windows/API.cs +++ b/Source/OpenTK/Platform/Windows/API.cs @@ -1433,7 +1433,9 @@ namespace OpenTK.Platform.Windows #endregion #region PixelFormatDescriptor - + + #pragma warning disable 0169 + /// /// Describes a pixel format. It is used when interfacing with the WINAPI to create a new Context. /// Found in WinGDI.h @@ -1467,7 +1469,9 @@ namespace OpenTK.Platform.Windows internal int LayerMask; internal int VisibleMask; internal int DamageMask; - } + } + + #pragma warning restore 0169 #endregion