diff --git a/src/Generator.Converter/Options.cs b/src/Generator.Converter/Options.cs index b22bd87a..bd7ab1bd 100644 --- a/src/Generator.Converter/Options.cs +++ b/src/Generator.Converter/Options.cs @@ -13,10 +13,10 @@ // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: -// +// // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -37,16 +37,16 @@ // A Getopt::Long-inspired option parsing library for C#. // // NDesk.Options.OptionSet is built upon a key/value table, where the -// key is a option format string and the value is a delegate that is +// key is a option format string and the value is a delegate that is // invoked when the format string is matched. // // Option format strings: -// Regex-like BNF Grammar: +// Regex-like BNF Grammar: // name: .+ // type: [=:] // sep: ( [^{}]+ | '{' .+ '}' )? // aliases: ( name type sep ) ( '|' name type sep )* -// +// // Each '|'-delimited name is an alias for the associated action. If the // format string ends in a '=', it has a required value. If the format // string ends in a ':', it has an optional value. If neither '=' or ':' @@ -92,7 +92,7 @@ // p.Parse (new string[]{"-v", "--v", "/v", "-name=A", "/name", "B", "extra"}); // // The above would parse the argument string array, and would invoke the -// lambda expression three times, setting `verbose' to 3 when complete. +// lambda expression three times, setting `verbose' to 3 when complete. // It would also print out "A" and "B" to standard output. // The returned array would contain the string "extra". // @@ -208,7 +208,7 @@ namespace Mono.Options if (c.Option.OptionValueType == OptionValueType.Required && index >= values.Count) throw new OptionException (string.Format ( - c.OptionSet.MessageLocalizer ("Missing required value for option '{0}'."), c.OptionName), + c.OptionSet.MessageLocalizer ("Missing required value for option '{0}'."), c.OptionName), c.OptionName); } @@ -257,7 +257,7 @@ namespace Mono.Options set {option = value;} } - public string OptionName { + public string OptionName { get {return name;} set {name = value;} } @@ -277,7 +277,7 @@ namespace Mono.Options } public enum OptionValueType { - None, + None, Optional, Required, } @@ -318,7 +318,7 @@ namespace Mono.Options throw new ArgumentException ( string.Format ("Cannot provide maxValueCount of {0} for OptionValueType.None.", maxValueCount), "maxValueCount"); - if (Array.IndexOf (names, "<>") >= 0 && + if (Array.IndexOf (names, "<>") >= 0 && ((names.Length == 1 && this.type != OptionValueType.None) || (names.Length > 1 && this.MaxValueCount > 1))) throw new ArgumentException ( @@ -346,8 +346,8 @@ namespace Mono.Options protected static T Parse (string value, OptionContext c) { Type tt = typeof (T); - bool nullable = tt.IsValueType && tt.IsGenericType && - !tt.IsGenericTypeDefinition && + bool nullable = tt.IsValueType && tt.IsGenericType && + !tt.IsGenericTypeDefinition && tt.GetGenericTypeDefinition () == typeof (Nullable<>); Type targetType = nullable ? tt.GetGenericArguments () [0] : typeof (T); TypeConverter conv = TypeDescriptor.GetConverter (targetType); @@ -386,7 +386,7 @@ namespace Mono.Options names [i] = name.Substring (0, end); if (type == '\0' || type == name [end]) type = name [end]; - else + else throw new ArgumentException ( string.Format ("Conflicting option types: '{0}' vs. '{1}'.", type, name [end]), "prototype"); @@ -529,19 +529,6 @@ namespace Mono.Options throw new InvalidOperationException ("Option has no names!"); } - [Obsolete ("Use KeyedCollection.this[string]")] - protected Option GetOptionForName (string option) - { - if (option == null) - throw new ArgumentNullException ("option"); - try { - return base [option]; - } - catch (KeyNotFoundException) { - return null; - } - } - protected override void InsertItem (int index, Option item) { base.InsertItem (index, item); @@ -616,7 +603,7 @@ namespace Mono.Options { if (action == null) throw new ArgumentNullException ("action"); - Option p = new ActionOption (prototype, description, 1, + Option p = new ActionOption (prototype, description, 1, delegate (OptionValueCollection v) { action (v [0]); }); base.Add (p); return this; @@ -631,7 +618,7 @@ namespace Mono.Options { if (action == null) throw new ArgumentNullException ("action"); - Option p = new ActionOption (prototype, description, 2, + Option p = new ActionOption (prototype, description, 2, delegate (OptionValueCollection v) {action (v [0], v [1]);}); base.Add (p); return this; @@ -705,18 +692,18 @@ namespace Mono.Options OptionContext c = CreateOptionContext (); c.OptionIndex = -1; var def = GetOptionForName ("<>"); - var unprocessed = + var unprocessed = from argument in arguments where ++c.OptionIndex >= 0 && (process || def != null) ? process - ? argument == "--" + ? argument == "--" ? (process = false) : !Parse (argument, c) - ? def != null - ? Unprocessed (null, def, c, argument) + ? def != null + ? Unprocessed (null, def, c, argument) : true : false - : def != null + : def != null ? Unprocessed (null, def, c, argument) : true : true @@ -809,7 +796,7 @@ namespace Mono.Options c.Option.Invoke (c); break; case OptionValueType.Optional: - case OptionValueType.Required: + case OptionValueType.Required: ParseValue (v, c); break; } @@ -828,17 +815,17 @@ namespace Mono.Options private void ParseValue (string option, OptionContext c) { if (option != null) - foreach (string o in c.Option.ValueSeparators != null + foreach (string o in c.Option.ValueSeparators != null ? option.Split (c.Option.ValueSeparators, StringSplitOptions.None) : new string[]{option}) { c.OptionValues.Add (o); } - if (c.OptionValues.Count == c.Option.MaxValueCount || + if (c.OptionValues.Count == c.Option.MaxValueCount || c.Option.OptionValueType == OptionValueType.Optional) c.Option.Invoke (c); else if (c.OptionValues.Count > c.Option.MaxValueCount) { throw new OptionException (localizer (string.Format ( - "Error: Found {0} option values when expecting {1}.", + "Error: Found {0} option values when expecting {1}.", c.OptionValues.Count, c.Option.MaxValueCount)), c.OptionName); } @@ -922,7 +909,7 @@ namespace Mono.Options bool indent = false; string prefix = new string (' ', OptionWidth+2); foreach (string line in GetLines (localizer (GetDescription (p.Description)))) { - if (indent) + if (indent) o.Write (prefix); o.WriteLine (line); indent = true; @@ -947,7 +934,7 @@ namespace Mono.Options Write (o, ref written, names [0]); } - for ( i = GetNextOptionIndex (names, i+1); + for ( i = GetNextOptionIndex (names, i+1); i < names.Length; i = GetNextOptionIndex (names, i+1)) { Write (o, ref written, ", "); Write (o, ref written, names [i].Length == 1 ? "-" : "--"); @@ -960,7 +947,7 @@ namespace Mono.Options Write (o, ref written, localizer ("[")); } Write (o, ref written, localizer ("=" + GetArgumentName (0, p.MaxValueCount, p.Description))); - string sep = p.ValueSeparators != null && p.ValueSeparators.Length > 0 + string sep = p.ValueSeparators != null && p.ValueSeparators.Length > 0 ? p.ValueSeparators [0] : " "; for (int c = 1; c < p.MaxValueCount; ++c) { diff --git a/src/OpenTK.GLControl/Agl.cs b/src/OpenTK.GLControl/Agl.cs index 560aebda..b56d1a5e 100644 --- a/src/OpenTK.GLControl/Agl.cs +++ b/src/OpenTK.GLControl/Agl.cs @@ -35,7 +35,7 @@ using System.Runtime.InteropServices; namespace OpenTK.Platform.MacOS { #pragma warning disable 0169 - + /* ** Macintosh device type. */ @@ -58,16 +58,16 @@ namespace OpenTK.Platform.MacOS unsafe static partial class Agl { - + const string agl = "/System/Library/Frameworks/AGL.framework/Versions/Current/AGL"; - + /* ** AGL API version. */ const int AGL_VERSION_2_0 = 1; - + /************************************************************************/ - + /* ** Attribute names for aglChoosePixelFormat and aglDescribePixelFormat. */ @@ -196,7 +196,7 @@ namespace OpenTK.Platform.MacOS AGL_SURFACE_BACKING_SIZE = 304, /* 2 params. Width/height of surface backing size */ AGL_ENABLE_SURFACE_BACKING_SIZE = 305, /* Enable or disable surface backing size override */ AGL_SURFACE_VOLATILE = 306, /* Flag surface to candidate for deletion */ - } + } /* ** Option names for aglConfigure. */ @@ -278,7 +278,7 @@ namespace OpenTK.Platform.MacOS internal enum AglError { NoError = 0, /* no error */ - + BadAttribute = 10000, /* invalid pixel format attribute */ BadProperty = 10001, /* invalid renderer property */ BadPixelFormat = 10002, /* invalid pixel format */ @@ -299,7 +299,7 @@ namespace OpenTK.Platform.MacOS BadConnection = 10017, /* invalid CoreGraphics connection */ } /************************************************************************/ - + /* ** Pixel format functions */ @@ -319,9 +319,7 @@ namespace OpenTK.Platform.MacOS [DllImport(agl)] internal static extern void aglDestroyPixelFormat(AGLPixelFormat pix); [DllImport(agl)] internal static extern AGLPixelFormat aglNextPixelFormat(AGLPixelFormat pix); [DllImport(agl)] internal static extern bool aglDescribePixelFormat(AGLPixelFormat pix, PixelFormatAttribute attrib, out int value); - [Obsolete("Use aglDisplaysOfPixelFormat instead.")] - [DllImport(agl)] static extern AGLDevice *aglDevicesOfPixelFormat(AGLPixelFormat pix, int *ndevs); - + /* ** Renderer information functions */ @@ -329,7 +327,7 @@ namespace OpenTK.Platform.MacOS [DllImport(agl)] static extern void aglDestroyRendererInfo(AGLRendererInfo rend); [DllImport(agl)] static extern AGLRendererInfo aglNextRendererInfo(AGLRendererInfo rend); [DllImport(agl)] static extern byte aglDescribeRenderer(AGLRendererInfo rend, int prop, out int value); - + /* ** Context functions */ @@ -362,12 +360,12 @@ namespace OpenTK.Platform.MacOS #endregion [DllImport(agl)] internal static extern AGLContext aglGetCurrentContext(); - - + + /* ** Drawable Functions */ - [DllImport(agl,EntryPoint="aglSetDrawable")] + [DllImport(agl,EntryPoint="aglSetDrawable")] static extern byte _aglSetDrawable(AGLContext ctx, AGLDrawable draw); internal static void aglSetDrawable(AGLContext ctx, AGLDrawable draw) @@ -405,22 +403,22 @@ namespace OpenTK.Platform.MacOS */ [DllImport(agl)] static extern byte aglSetVirtualScreen(AGLContext ctx, int screen); [DllImport(agl)] static extern int aglGetVirtualScreen(AGLContext ctx); - + /* ** Obtain version numbers */ [DllImport(agl)] static extern void aglGetVersion(int *major, int *minor); - + /* ** Global library options */ [DllImport(agl)] static extern byte aglConfigure(GLenum pname, uint param); - + /* ** Swap functions */ [DllImport(agl)] internal static extern void aglSwapBuffers(AGLContext ctx); - + /* ** Per context options */ @@ -454,31 +452,31 @@ namespace OpenTK.Platform.MacOS { return Marshal.PtrToStringAnsi(_aglErrorString(code)); } - + /* ** Soft reset function */ [DllImport(agl)] static extern void aglResetLibrary(); - + /* ** Surface texture function */ [DllImport(agl)] static extern void aglSurfaceTexture (AGLContext context, GLenum target, GLenum internalformat, AGLContext surfacecontext) ; - + /* ** PBuffer functions */ - [DllImport(agl)] static extern byte aglCreatePBuffer (int width, int height, GLenum target, GLenum internalFormat, long max_level, AGLPbuffer *pbuffer); + [DllImport(agl)] static extern byte aglCreatePBuffer (int width, int height, GLenum target, GLenum internalFormat, long max_level, AGLPbuffer *pbuffer); [DllImport(agl)] static extern byte aglDestroyPBuffer (AGLPbuffer pbuffer); [DllImport(agl)] static extern byte aglDescribePBuffer (AGLPbuffer pbuffer, int *width, int *height, GLenum *target, GLenum *internalFormat, int *max_level); [DllImport(agl)] static extern byte aglTexImagePBuffer (AGLContext ctx, AGLPbuffer pbuffer, int source); - + /* ** Pbuffer Drawable Functions */ [DllImport(agl)] static extern byte aglSetPBuffer (AGLContext ctx, AGLPbuffer pbuffer, int face, int level, int screen) ; [DllImport(agl)] static extern byte aglGetPBuffer (AGLContext ctx, AGLPbuffer *pbuffer, int *face, int *level, int *screen) ; - + /* ** CGL functions */ diff --git a/src/OpenTK.GLControl/GLControl.cs b/src/OpenTK.GLControl/GLControl.cs index 2bb74976..8704c48f 100644 --- a/src/OpenTK.GLControl/GLControl.cs +++ b/src/OpenTK.GLControl/GLControl.cs @@ -6,7 +6,7 @@ // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -104,7 +104,7 @@ namespace OpenTK { Backend = PlatformBackend.PreferNative }); - + SetStyle(ControlStyles.Opaque, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); @@ -273,7 +273,7 @@ namespace OpenTK return; } - if (Configuration.RunningOnMacOS) + if (Configuration.RunningOnMacOS) { DelayUpdate delay = PerformContextUpdate; BeginInvoke(delay); //Need the native window to resize first otherwise our control will be in the wrong place. @@ -480,38 +480,6 @@ namespace OpenTK { get { return implementation.WindowInfo; } } - - #endregion - - #region public Bitmap GrabScreenshot() - - /// - /// Grabs a screenshot of the frontbuffer contents. - /// When using multiple GLControls, ensure that - /// is current before accessing this property. - /// - /// - /// - /// A System.Drawing.Bitmap, containing the contents of the frontbuffer. - /// - /// Occurs when no OpenTK.Graphics.GraphicsContext is current in the calling thread. - /// - [Obsolete("This method will not work correctly with OpenGL|ES. Please use GL.ReadPixels to capture the contents of the framebuffer (refer to http://www.opentk.com/doc/graphics/save-opengl-rendering-to-disk for more information).")] - public Bitmap GrabScreenshot() - { - ValidateState(); - ValidateContext("GrabScreenshot()"); - - Bitmap bmp = new Bitmap(this.ClientSize.Width, this.ClientSize.Height); - System.Drawing.Imaging.BitmapData data = - bmp.LockBits(this.ClientRectangle, System.Drawing.Imaging.ImageLockMode.WriteOnly, - System.Drawing.Imaging.PixelFormat.Format24bppRgb); - GL.ReadPixels(0, 0, this.ClientSize.Width, this.ClientSize.Height, PixelFormat.Bgr, PixelType.UnsignedByte, - data.Scan0); - bmp.UnlockBits(data); - bmp.RotateFlip(RotateFlipType.RotateNoneFlipY); - return bmp; - } #endregion diff --git a/src/OpenTK/BindingsBase.cs b/src/OpenTK/BindingsBase.cs index 8043f4e6..09b44b32 100644 --- a/src/OpenTK/BindingsBase.cs +++ b/src/OpenTK/BindingsBase.cs @@ -6,7 +6,7 @@ // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -41,24 +41,6 @@ namespace OpenTK { #region Fields - /// - /// A reflection handle to the nested type that contains the function delegates. - /// - [Obsolete("Not used")] - readonly protected Type DelegatesClass; - - /// - /// A refection handle to the nested type that contains core functions (i.e. not extensions). - /// - [Obsolete("Not used")] - readonly protected Type CoreClass; - - /// - /// A mapping of core function names to MethodInfo handles. - /// - [Obsolete("Not used")] - readonly protected SortedList CoreFunctionMap; - bool rebuildExtensionList = true; #endregion @@ -106,7 +88,7 @@ namespace OpenTK /// Gets an object that can be used to synchronize access to the bindings implementation. /// /// This object should be unique across bindings but consistent between bindings - /// of the same type. For example, ES10.GL, OpenGL.GL and CL10.CL should all return + /// of the same type. For example, ES10.GL, OpenGL.GL and CL10.CL should all return /// unique objects, but all instances of ES10.GL should return the same object. protected abstract object SyncRoot { get; } diff --git a/src/OpenTK/DisplayDevice.cs b/src/OpenTK/DisplayDevice.cs index bfd3960a..6d5e354c 100644 --- a/src/OpenTK/DisplayDevice.cs +++ b/src/OpenTK/DisplayDevice.cs @@ -6,7 +6,7 @@ // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -51,7 +51,7 @@ namespace OpenTK DisplayResolution original_resolution; List available_resolutions = new List(); IList available_resolutions_readonly; - + internal object Id; // A platform-specific id for this monitor static readonly object display_lock = new object(); @@ -287,31 +287,6 @@ namespace OpenTK #endregion - #region public static IList AvailableDisplays - - /// - /// Gets the list of available objects. - /// This function allocates memory. - /// - [Obsolete("Use GetDisplay(DisplayIndex) instead.")] - public static IList AvailableDisplays - { - get - { - List displays = new List(); - for (int i = 0; i < 6; i++) - { - DisplayDevice dev = GetDisplay(DisplayIndex.First + i); - if (dev != null) - displays.Add(dev); - } - - return displays.AsReadOnly(); - } - } - - #endregion - #region public static DisplayDevice Default /// Gets the default (primary) display of this system. diff --git a/src/OpenTK/GameWindow.cs b/src/OpenTK/GameWindow.cs index 2a6df0c1..cb8f22e3 100644 --- a/src/OpenTK/GameWindow.cs +++ b/src/OpenTK/GameWindow.cs @@ -6,7 +6,7 @@ // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -79,19 +79,13 @@ namespace OpenTK readonly Stopwatch watch = new Stopwatch(); - #pragma warning disable 612,618 - readonly IJoystickDriver LegacyJoystick = - Factory.Default.CreateLegacyJoystickDriver(); - #pragma warning restore 612,618 - - IGraphicsContext glContext; bool isExiting = false; double update_period, render_period; double target_update_period, target_render_period; - + double update_time; // length of last UpdateFrame event double render_time; // length of last RenderFrame event @@ -462,7 +456,7 @@ namespace OpenTK while (elapsed > 0 && elapsed + update_epsilon >= TargetUpdatePeriod) { RaiseUpdateFrame(elapsed, ref timestamp); - + // Calculate difference (positive or negative) between // actual elapsed time and target elapsed time. We must // compensate for this difference. @@ -581,51 +575,6 @@ namespace OpenTK #endregion - #region Joysticks - - /// - /// Gets a readonly IList containing all available OpenTK.Input.JoystickDevices. - /// - [Obsolete("Use OpenTK.Input.Joystick and GamePad instead")] - public IList Joysticks - { - get { return LegacyJoystick.Joysticks; } - } - - #endregion - - #region Keyboard - - #pragma warning disable 0612 - - /// - /// Gets the primary Keyboard device, or null if no Keyboard exists. - /// - public KeyboardDevice Keyboard - { - get { return InputDriver.Keyboard.Count > 0 ? InputDriver.Keyboard[0] : null; } - } - - #pragma warning restore 0612 - - #endregion - - #region Mouse - - #pragma warning disable 0612 - - /// - /// Gets the primary Mouse device, or null if no Mouse exists. - /// - public MouseDevice Mouse - { - get { return InputDriver.Mouse.Count > 0 ? InputDriver.Mouse[0] : null; } - } - - #pragma warning restore 0612 - - #endregion - #region --- GameWindow Timing --- // TODO: Disabled because it is not reliable enough. Use vsync as a workaround. diff --git a/src/OpenTK/Graphics/Color4.cs b/src/OpenTK/Graphics/Color4.cs index 3174d701..9f2d2602 100644 --- a/src/OpenTK/Graphics/Color4.cs +++ b/src/OpenTK/Graphics/Color4.cs @@ -6,7 +6,7 @@ // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -47,17 +47,17 @@ namespace OpenTK.Graphics /// The red component of this Color4 structure. /// public float R; - + /// /// The green component of this Color4 structure. /// public float G; - + /// /// The blue component of this Color4 structure. /// public float B; - + /// /// The alpha component of this Color4 structure. /// @@ -97,15 +97,6 @@ namespace OpenTK.Graphics A = a / (float)Byte.MaxValue; } - /// - /// Constructs a new Color4 structure from the specified System.Drawing.Color. - /// - /// The System.Drawing.Color containing the component values. - [Obsolete("Use new Color4(r, g, b, a) instead.")] - public Color4(Color color) - : this(color.R, color.G, color.B, color.A) - { } - #endregion #region Public Members @@ -1276,7 +1267,7 @@ namespace OpenTK.Graphics return new Vector4(x, y, z, rgb.A); } - #endregion + #endregion #region YUV diff --git a/src/OpenTK/Graphics/GraphicsBindingsBase.cs b/src/OpenTK/Graphics/GraphicsBindingsBase.cs index 79cd42b6..d8815407 100644 --- a/src/OpenTK/Graphics/GraphicsBindingsBase.cs +++ b/src/OpenTK/Graphics/GraphicsBindingsBase.cs @@ -6,7 +6,7 @@ // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -36,22 +36,6 @@ namespace OpenTK.Graphics /// public abstract class GraphicsBindingsBase : BindingsBase { - /// - /// Contains the list of API entry points (function pointers). - /// This field must be set by an inheriting class. - /// - [Obsolete("Not used - this field remains for 1.1 API compatibility")] - protected IntPtr[] EntryPointsInstance; - - /// - /// with the 1.1 API. - /// Contains the list of API entry point names. - /// This field must be set by an inheriting class. - /// - [Obsolete("Not used - this field remains for 1.1 API compatibility")] - protected string[] EntryPointNamesInstance; - - internal IntPtr[] _EntryPointsInstance; internal byte[] _EntryPointNamesInstance; internal int[] _EntryPointNameOffsetsInstance; diff --git a/src/OpenTK/Graphics/GraphicsContext.cs b/src/OpenTK/Graphics/GraphicsContext.cs index a2104e36..2f8f1c53 100644 --- a/src/OpenTK/Graphics/GraphicsContext.cs +++ b/src/OpenTK/Graphics/GraphicsContext.cs @@ -6,7 +6,7 @@ // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -40,7 +40,7 @@ namespace OpenTK.Graphics public sealed class GraphicsContext : IGraphicsContext, IGraphicsContextInternal { /// - /// Used to retrive function pointers by name. + /// Used to retrive function pointers by name. /// /// The function name. /// A function pointer to , or IntPtr.Zero @@ -67,7 +67,7 @@ namespace OpenTK.Graphics static bool share_contexts = true; static bool direct_rendering = true; - readonly static object SyncRoot = new object(); + readonly static object SyncRoot = new object(); // Maps OS-specific context handles to GraphicsContext instances. readonly static Dictionary available_contexts = new Dictionary(); @@ -102,7 +102,8 @@ namespace OpenTK.Graphics } /// - /// Constructs a new GraphicsContext with the specified GraphicsMode, version and flags, and attaches it to the specified window. + /// Constructs a new GraphicsContext with the specified GraphicsMode, version and flags, and attaches it to the specified window. A dummy context will be created if both + /// the handle and the window are null. /// /// The OpenTK.Graphics.GraphicsMode of the GraphicsContext. /// The OpenTK.Platform.IWindowInfo to attach the GraphicsContext to. @@ -252,7 +253,8 @@ namespace OpenTK.Graphics } /// - /// Constructs a new GraphicsContext from a pre-existing context created outside of OpenTK. + /// Constructs a new GraphicsContext from a pre-existing context created outside of OpenTK. A dummy context will be created if both + /// the handle and the window are null. /// /// The handle of the existing context. This must be a valid, unique handle that is not known to OpenTK. /// This parameter is reserved. @@ -360,45 +362,6 @@ namespace OpenTK.Graphics #region --- Static Members --- - #region public static GraphicsContext CreateDummyContext() - - /// - /// Creates a dummy GraphicsContext to allow OpenTK to work with contexts created by external libraries. - /// - /// A new, dummy GraphicsContext instance. - /// - /// Instances created by this method will not be functional. Instance methods will have no effect. - /// This method requires that a context is current on the calling thread. - /// - [Obsolete("Use GraphicsContext(ContextHandle, IWindowInfo) constructor instead")] - public static GraphicsContext CreateDummyContext() - { - ContextHandle handle = GetCurrentContext(); - if (handle == ContextHandle.Zero) - throw new InvalidOperationException("No GraphicsContext is current on the calling thread."); - - return CreateDummyContext(handle); - } - - /// - /// Creates a dummy GraphicsContext to allow OpenTK to work with contexts created by external libraries. - /// - /// The handle of a context. - /// A new, dummy GraphicsContext instance. - /// - /// Instances created by this method will not be functional. Instance methods will have no effect. - /// - [Obsolete("Use GraphicsContext(ContextHandle, IWindowInfo) constructor instead")] - public static GraphicsContext CreateDummyContext(ContextHandle handle) - { - if (handle == ContextHandle.Zero) - throw new ArgumentOutOfRangeException("handle"); - - return new GraphicsContext(handle, (IWindowInfo)null); - } - - #endregion - #region public static void Assert() /// @@ -538,31 +501,11 @@ namespace OpenTK.Graphics private set { disposed = value; } } - /// - /// [obsolete] Use SwapInterval property instead. - /// Gets or sets a value indicating whether VSync is enabled. When VSync is - /// enabled, calls will be synced to the refresh - /// rate of the that contains improving visual - /// quality and reducing CPU usage. However, systems that cannot maintain - /// the requested rendering rate will suffer from large jumps in performance. - /// This can be counteracted by increasing the - /// value. - /// - [Obsolete("Use SwapInterval property instead.")] - public bool VSync - { -#pragma warning disable 0612, 0618 // CS0612/CS0618: 'member' is obsolete - get { return implementation.VSync; } - set { implementation.VSync = value; } -#pragma warning restore 0612, 0618 - } - /// /// Gets or sets a positive integer in the range [1, n), indicating the number of /// refreshes between consecutive /// calls. The maximum value for n is /// implementation-dependent. The default value is 1. - /// This value will only affect instances where is enabled. /// Invalid values will be clamped to the valid range. /// public int SwapInterval @@ -594,7 +537,7 @@ namespace OpenTK.Graphics implementation.LoadAll(); } - + #endregion #region --- IGraphicsContextInternal Members --- diff --git a/src/OpenTK/Graphics/IGraphicsContext.cs b/src/OpenTK/Graphics/IGraphicsContext.cs index a71caf91..56e39a46 100644 --- a/src/OpenTK/Graphics/IGraphicsContext.cs +++ b/src/OpenTK/Graphics/IGraphicsContext.cs @@ -41,24 +41,11 @@ namespace OpenTK.Graphics /// bool IsDisposed { get; } - /// - /// Gets or sets a value indicating whether VSync is enabled. When VSync is - /// enabled, calls will be synced to the refresh - /// rate of the that contains improving visual - /// quality and reducing CPU usage. However, systems that cannot maintain - /// the requested rendering rate will suffer from large jumps in performance. - /// This can be counteracted by increasing the - /// value. - /// - [Obsolete("Use SwapInterval property instead.")] - bool VSync { get; set; } - /// /// Gets or sets a positive integer in the range [1, n), indicating the number of /// refreshes between consecutive /// calls. The maximum value for n is /// implementation-dependent. The default value is 1. - /// This value will only affect instances where is enabled. /// Invalid values will be clamped to the valid range. /// int SwapInterval { get; set; } diff --git a/src/OpenTK/Graphics/OpenGL/GLHelper.cs b/src/OpenTK/Graphics/OpenGL/GLHelper.cs index 580b06d8..d5068cec 100644 --- a/src/OpenTK/Graphics/OpenGL/GLHelper.cs +++ b/src/OpenTK/Graphics/OpenGL/GLHelper.cs @@ -6,7 +6,7 @@ // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -97,20 +97,6 @@ namespace OpenTK.Graphics.OpenGL #endregion - #region --- Public Members --- - - /// - /// Loads all OpenGL entry points (core and extension). - /// This method is provided for compatibility purposes with older OpenTK versions. - /// - [Obsolete("If you are using a context constructed outside of OpenTK, create a new GraphicsContext and pass your context handle to it. Otherwise, there is no need to call this method.")] - public static void LoadAll() - { - new GL().LoadEntryPoints(); - } - - #endregion - #region --- Protected Members --- /// @@ -125,11 +111,6 @@ namespace OpenTK.Graphics.OpenGL #region --- GL Overloads --- -#pragma warning disable 3019 -#pragma warning disable 1591 -#pragma warning disable 1572 -#pragma warning disable 1573 - // Note: Mono 1.9.1 truncates StringBuilder results (for 'out string' parameters). // We work around this issue by doubling the StringBuilder capacity. @@ -1380,230 +1361,13 @@ namespace OpenTK.Graphics.OpenGL #endregion - #region Obsolete - - [Obsolete("Use DisableClientState(ArrayCap) instead")] - public static void DisableClientState(OpenTK.Graphics.OpenGL.EnableCap array) - { - DisableClientState((ArrayCap)array); - } - - [Obsolete("Use EnableClientState(ArrayCap) instead.")] - public static void EnableClientState(OpenTK.Graphics.OpenGL.EnableCap array) - { - EnableClientState((ArrayCap)array); - } - - [Obsolete("Use GetActiveUniforms(..., ActiveUniformParameter, ...) instead.")] - public static void GetActiveUniforms(Int32 program, Int32 uniformCount, Int32[] uniformIndices, ArbUniformBufferObject pname, [OutAttribute] Int32[] @params) - { - GetActiveUniforms(program, uniformCount, uniformIndices, (ActiveUniformParameter)pname, @params); - } - - [Obsolete("Use GetActiveUniforms(..., ActiveUniformParameter, ...) instead.")] - public static void GetActiveUniforms(Int32 program, Int32 uniformCount, ref Int32 uniformIndices, ArbUniformBufferObject pname, [OutAttribute] out Int32 @params) - { - GetActiveUniforms(program, uniformCount, ref uniformIndices, (ActiveUniformParameter)pname, out @params); - } - - [System.CLSCompliant(false)] - [Obsolete("Use GetActiveUniforms(..., ActiveUniformParameter, ...) instead.")] - public static unsafe void GetActiveUniforms(Int32 program, Int32 uniformCount, Int32* uniformIndices, ArbUniformBufferObject pname, [OutAttribute] Int32* @params) - { - GetActiveUniforms(program, uniformCount, uniformIndices, (ActiveUniformParameter)pname, @params); - } - - [System.CLSCompliant(false)] - [Obsolete("Use GetActiveUniforms(..., ActiveUniformParameter, ...) instead.")] - public static void GetActiveUniforms(UInt32 program, Int32 uniformCount, UInt32[] uniformIndices, ArbUniformBufferObject pname, [OutAttribute] Int32[] @params) - { - GetActiveUniforms(program, uniformCount, uniformIndices, (ActiveUniformParameter)pname, @params); - } - - [System.CLSCompliant(false)] - [Obsolete("Use GetActiveUniforms(..., ActiveUniformParameter, ...) instead.")] - public static void GetActiveUniforms(UInt32 program, Int32 uniformCount, ref UInt32 uniformIndices, ArbUniformBufferObject pname, [OutAttribute] out Int32 @params) - { - GetActiveUniforms(program, uniformCount, ref uniformIndices, (ActiveUniformParameter)pname, out @params); - } - - [System.CLSCompliant(false)] - [Obsolete("Use GetActiveUniforms(..., ActiveUniformParameter, ...) instead.")] - public static unsafe void GetActiveUniforms(UInt32 program, Int32 uniformCount, UInt32* uniformIndices, ArbUniformBufferObject pname, [OutAttribute] Int32* @params) - { - GetActiveUniforms(program, uniformCount, uniformIndices, (ActiveUniformParameter)pname, @params); - } - - [Obsolete("Use strongly-typed overload instead")] - public static void GetBufferParameteri64(Version32 target, Version32 pname, [OutAttribute] Int64[] @params) - { - GL.GetBufferParameter((BufferTarget)target, (BufferParameterName)pname, @params); - } - - [Obsolete("Use strongly-typed overload instead")] - public static void GetBufferParameteri64(Version32 target, Version32 pname, out Int64 @params) - { - GL.GetBufferParameter((BufferTarget)target, (BufferParameterName)pname, out @params); - } - - [Obsolete("Use strongly-typed overload instead")] - [CLSCompliant(false)] - public static unsafe void GetBufferParameteri64(Version32 target, Version32 pname, [OutAttribute] Int64* @params) - { - GL.GetBufferParameter((BufferTarget)target, (BufferParameterName)pname, @params); - } - - [Obsolete("Use GL.Arb.FramebufferTextureFace instead (OpenGL spec bug)")] - public static void FramebufferTextureFace(Version32 target, Version32 attachment, - int texture, int level, Version32 face) - { - Arb.FramebufferTextureFace((FramebufferTarget)target, - (FramebufferAttachment)attachment, texture, level, (TextureTarget)face); - } - - [Obsolete("Use GL.Arb.FramebufferTextureFace instead (OpenGL spec bug)")] - [CLSCompliant(false)] - public static void FramebufferTextureFace(Version32 target, Version32 attachment, - uint texture, int level, Version32 face) - { - Arb.FramebufferTextureFace((FramebufferTarget)target, - (FramebufferAttachment)attachment, texture, level, (TextureTarget)face); - } - - - public static partial class Arb - { - [Obsolete("Use ProgramParameter(..., AssemblyProgramParameterArb, ...) instead.")] - public static void ProgramParameter(Int32 program, ArbGeometryShader4 pname, Int32 value) - { - ProgramParameter(program, (AssemblyProgramParameterArb)pname, value); - } - - [Obsolete("Use ProgramParameter(..., AssemblyProgramParameterArb, ...) instead.")] - [CLSCompliant(false)] - public static void ProgramParameter(UInt32 program, ArbGeometryShader4 pname, Int32 value) - { - ProgramParameter(program, (AssemblyProgramParameterArb)pname, value); - } - } - - public static partial class Ext - { - /// [requires: EXT_direct_state_access] - [Obsolete("Use ClearNamedBufferSubData(..., format, type, data) instead.")] - public static void ClearNamedBufferSubData(Int32 buffer, OpenTK.Graphics.OpenGL.ExtDirectStateAccess internalformat, OpenTK.Graphics.OpenGL.PixelFormat format, OpenTK.Graphics.OpenGL.PixelType type, IntPtr offset, IntPtr size, IntPtr data) - { - ClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); - } - - /// [requires: EXT_direct_state_access] - [Obsolete("Use ClearNamedBufferSubData(..., format, type, data) instead.")] - [CLSCompliant(false)] - public static void ClearNamedBufferSubData(Int32 buffer, OpenTK.Graphics.OpenGL.ExtDirectStateAccess internalformat, OpenTK.Graphics.OpenGL.PixelFormat format, OpenTK.Graphics.OpenGL.PixelType type, IntPtr offset, IntPtr size, [InAttribute, OutAttribute] T6[] data) - where T6 : struct - { - ClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); - } - - /// [requires: EXT_direct_state_access] - [Obsolete("Use ClearNamedBufferSubData(..., format, type, data) instead.")] - [CLSCompliant(false)] - public static void ClearNamedBufferSubData(Int32 buffer, OpenTK.Graphics.OpenGL.ExtDirectStateAccess internalformat, OpenTK.Graphics.OpenGL.PixelFormat format, OpenTK.Graphics.OpenGL.PixelType type, IntPtr offset, IntPtr size, [InAttribute, OutAttribute] T6[,] data) - where T6 : struct - { - ClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); - } - - /// [requires: EXT_direct_state_access] - [Obsolete("Use ClearNamedBufferSubData(..., format, type, data) instead.")] - [CLSCompliant(false)] - public static void ClearNamedBufferSubData(Int32 buffer, OpenTK.Graphics.OpenGL.ExtDirectStateAccess internalformat, OpenTK.Graphics.OpenGL.PixelFormat format, OpenTK.Graphics.OpenGL.PixelType type, IntPtr offset, IntPtr size, [InAttribute, OutAttribute] T6[,,] data) - where T6 : struct - { - ClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); - } - - /// [requires: EXT_direct_state_access] - [Obsolete("Use ClearNamedBufferSubData(..., format, type, data) instead.")] - [CLSCompliant(false)] - public static void ClearNamedBufferSubData(Int32 buffer, OpenTK.Graphics.OpenGL.ExtDirectStateAccess internalformat, OpenTK.Graphics.OpenGL.PixelFormat format, OpenTK.Graphics.OpenGL.PixelType type, IntPtr offset, IntPtr size, [InAttribute, OutAttribute] ref T6 data) - where T6 : struct - { - ClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, ref data); - } - - /// [requires: EXT_direct_state_access] - [Obsolete("Use ClearNamedBufferSubData(..., format, type, data) instead.")] - [CLSCompliant(false)] - public static void ClearNamedBufferSubData(UInt32 buffer, OpenTK.Graphics.OpenGL.ExtDirectStateAccess internalformat, OpenTK.Graphics.OpenGL.PixelFormat format, OpenTK.Graphics.OpenGL.PixelType type, IntPtr offset, IntPtr size, IntPtr data) - { - ClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); - } - - /// [requires: EXT_direct_state_access] - [Obsolete("Use ClearNamedBufferSubData(..., format, type, data) instead.")] - [CLSCompliant(false)] - public static void ClearNamedBufferSubData(UInt32 buffer, OpenTK.Graphics.OpenGL.ExtDirectStateAccess internalformat, OpenTK.Graphics.OpenGL.PixelFormat format, OpenTK.Graphics.OpenGL.PixelType type, IntPtr offset, IntPtr size, [InAttribute, OutAttribute] T6[] data) - where T6 : struct - { - ClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); - } - - /// [requires: EXT_direct_state_access] - [Obsolete("Use ClearNamedBufferSubData(..., format, type, data) instead.")] - [CLSCompliant(false)] - public static void ClearNamedBufferSubData(UInt32 buffer, OpenTK.Graphics.OpenGL.ExtDirectStateAccess internalformat, OpenTK.Graphics.OpenGL.PixelFormat format, OpenTK.Graphics.OpenGL.PixelType type, IntPtr offset, IntPtr size, [InAttribute, OutAttribute] T6[,] data) - where T6 : struct - { - ClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); - } - - /// [requires: EXT_direct_state_access] - [Obsolete("Use ClearNamedBufferSubData(..., format, type, data) instead.")] - [CLSCompliant(false)] - public static void ClearNamedBufferSubData(UInt32 buffer, OpenTK.Graphics.OpenGL.ExtDirectStateAccess internalformat, OpenTK.Graphics.OpenGL.PixelFormat format, OpenTK.Graphics.OpenGL.PixelType type, IntPtr offset, IntPtr size, [InAttribute, OutAttribute] T6[,,] data) - where T6 : struct - { - ClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); - } - - /// [requires: EXT_direct_state_access] - [Obsolete("Use ClearNamedBufferSubData(..., format, type, data) instead.")] - [CLSCompliant(false)] - public static void ClearNamedBufferSubData(UInt32 buffer, OpenTK.Graphics.OpenGL.ExtDirectStateAccess internalformat, OpenTK.Graphics.OpenGL.PixelFormat format, OpenTK.Graphics.OpenGL.PixelType type, IntPtr offset, IntPtr size, [InAttribute, OutAttribute] ref T6 data) - where T6 : struct - { - ClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, ref data); - } - - [Obsolete("Use ProgramParameter(..., AssemblyProgramParameterArb, ...) instead.")] - public static void ProgramParameter(Int32 program, ExtGeometryShader4 pname, Int32 value) - { - ProgramParameter(program, (AssemblyProgramParameterArb)pname, value); - } - - [Obsolete("Use ProgramParameter(..., AssemblyProgramParameterArb, ...) instead.")] - [CLSCompliant(false)] - public static void ProgramParameter(UInt32 program, ExtGeometryShader4 pname, Int32 value) - { - ProgramParameter(program, (AssemblyProgramParameterArb)pname, value); - } - } - - #endregion - -#pragma warning restore 3019 -#pragma warning restore 1591 -#pragma warning restore 1572 -#pragma warning restore 1573 - #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 + /// Defines the signature of a debug callback for /// . /// /// The id of this debug message. @@ -1618,7 +1382,7 @@ namespace OpenTK.Graphics.OpenGL int length, IntPtr message, IntPtr userParam); /// - /// Defines the signature of a debug callback for + /// Defines the signature of a debug callback for /// . /// /// The for this debug message. @@ -1635,7 +1399,7 @@ namespace OpenTK.Graphics.OpenGL IntPtr userParam); /// - /// Defines the signature of a debug callback for + /// Defines the signature of a debug callback for /// . /// /// The for this debug message. @@ -1652,7 +1416,7 @@ namespace OpenTK.Graphics.OpenGL IntPtr userParam); /// - /// Defines the signature of a debug callback for + /// Defines the signature of a debug callback for /// . /// /// The for this debug message. diff --git a/src/OpenTK/INativeWindow.cs b/src/OpenTK/INativeWindow.cs index 881bcc6c..a475af09 100644 --- a/src/OpenTK/INativeWindow.cs +++ b/src/OpenTK/INativeWindow.cs @@ -6,7 +6,7 @@ // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -37,7 +37,7 @@ using OpenTK.Platform; namespace OpenTK { /// - /// Defines the interface for a native window. + /// Defines the interface for a native window. /// public interface INativeWindow : IDisposable { @@ -50,32 +50,32 @@ namespace OpenTK /// Gets or sets the title of the window. /// string Title { get; set; } - + /// /// Gets a System.Boolean that indicates whether this window has input focus. /// bool Focused { get; } - + /// /// Gets or sets a System.Boolean that indicates whether the window is visible. /// bool Visible { get; set; } - + /// /// Gets a System.Boolean that indicates whether the window has been created and has not been destroyed. /// bool Exists { get; } - + /// /// Gets the for this window. /// IWindowInfo WindowInfo { get; } - + /// /// Gets or sets the for this window. /// WindowState WindowState { get; set; } - + /// /// Gets or sets the for this window. /// @@ -86,54 +86,48 @@ namespace OpenTK /// External bounds include the title bar, borders and drawing area of the window. /// Rectangle Bounds { get; set; } - + /// /// Gets or sets a structure that contains the location of this window on the desktop. /// Point Location { get; set; } - + /// /// Gets or sets a structure that contains the external size of this window. /// Size Size { get; set; } - + /// /// Gets or sets the horizontal location of this window on the desktop. /// int X { get; set; } - + /// /// Gets or sets the vertical location of this window on the desktop. /// int Y { get; set; } - + /// /// Gets or sets the external width of this window. /// int Width { get; set; } - + /// /// Gets or sets the external height of this window. /// int Height { get; set; } - + /// /// Gets or sets a structure that contains the internal bounds of this window, in client coordinates. /// The internal bounds include the drawing area of the window, but exclude the titlebar and window borders. /// Rectangle ClientRectangle { get; set; } - + /// /// Gets or sets a structure that contains the internal size this window. /// Size ClientSize { get; set; } - /// - /// This property is deprecated and should not be used. - /// - [Obsolete("Use OpenTK.Input.Mouse/Keyboard/Joystick/GamePad instead.")] - OpenTK.Input.IInputDriver InputDriver { get; } - /// /// Gets or sets the for this window. /// @@ -154,14 +148,14 @@ namespace OpenTK /// Closes this window. /// void Close(); - + /// /// Processes pending window events. /// void ProcessEvents(); - + /// - /// Transforms the specified point from screen to client coordinates. + /// Transforms the specified point from screen to client coordinates. /// /// /// A to transform. @@ -170,9 +164,9 @@ namespace OpenTK /// The point transformed to client coordinates. /// Point PointToClient(Point point); - + /// - /// Transforms the specified point from client to screen coordinates. + /// Transforms the specified point from client to screen coordinates. /// /// /// A to transform. @@ -183,32 +177,32 @@ namespace OpenTK Point PointToScreen(Point point); /// - /// Occurs whenever the window is moved. + /// Occurs whenever the window is moved. /// event EventHandler Move; /// - /// Occurs whenever the window is resized. + /// Occurs whenever the window is resized. /// event EventHandler Resize; /// - /// Occurs when the window is about to close. + /// Occurs when the window is about to close. /// event EventHandler Closing; /// - /// Occurs after the window has closed. + /// Occurs after the window has closed. /// event EventHandler Closed; /// - /// Occurs when the window is disposed. + /// Occurs when the window is disposed. /// event EventHandler Disposed; /// - /// Occurs when the property of the window changes. + /// Occurs when the property of the window changes. /// event EventHandler IconChanged; @@ -246,7 +240,7 @@ namespace OpenTK /// Occurs whenever a character is typed. /// event EventHandler KeyPress; - + /// /// Occurs whenever a keyboard key is released. /// diff --git a/src/OpenTK/Input/IInputDriver.cs b/src/OpenTK/Input/IInputDriver.cs deleted file mode 100644 index c5b320b5..00000000 --- a/src/OpenTK/Input/IInputDriver.cs +++ /dev/null @@ -1,24 +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.Text; - -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 - { - /// - /// Updates the state of the driver. - /// - void Poll(); - } -} diff --git a/src/OpenTK/Input/IJoystickDriver.cs b/src/OpenTK/Input/IJoystickDriver.cs deleted file mode 100644 index 0b6f73b9..00000000 --- a/src/OpenTK/Input/IJoystickDriver.cs +++ /dev/null @@ -1,45 +0,0 @@ -#region License -// -// The Open Toolkit Library License -// -// Copyright (c) 2006 - 2008 the Open Toolkit library, except where noted. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -// the Software, and to permit persons to whom the Software is furnished to do -// so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// -#endregion - -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenTK.Input -{ - /// - /// Defines the interface for JoystickDevice drivers. - /// - [Obsolete] - public interface IJoystickDriver - { - /// - /// Gets the list of available JoystickDevices. - /// - IList Joysticks { get; } - } -} diff --git a/src/OpenTK/Input/IKeyboardDriver.cs b/src/OpenTK/Input/IKeyboardDriver.cs deleted file mode 100644 index 20685074..00000000 --- a/src/OpenTK/Input/IKeyboardDriver.cs +++ /dev/null @@ -1,24 +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.Text; - -namespace OpenTK.Input -{ - /// - /// Defines the interface for KeyboardDevice drivers. - /// - [Obsolete] - public interface IKeyboardDriver - { - /// - /// Gets the list of available KeyboardDevices. - /// - IList Keyboard { get; } - } -} diff --git a/src/OpenTK/Input/IMouseDriver.cs b/src/OpenTK/Input/IMouseDriver.cs deleted file mode 100644 index 97713234..00000000 --- a/src/OpenTK/Input/IMouseDriver.cs +++ /dev/null @@ -1,24 +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.Text; - -namespace OpenTK.Input -{ - /// - /// Defines the interface for MouseDevice drivers. - /// - [Obsolete] - public interface IMouseDriver - { - /// - /// Gets the list of available MouseDevices. - /// - IList Mouse { get; } - } -} diff --git a/src/OpenTK/Input/MouseDevice.cs b/src/OpenTK/Input/MouseDevice.cs index 32585a03..9b2613d4 100644 --- a/src/OpenTK/Input/MouseDevice.cs +++ b/src/OpenTK/Input/MouseDevice.cs @@ -8,7 +8,7 @@ // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal - // in the Software without restriction, including without limitation the rights to + // in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -75,7 +75,7 @@ namespace OpenTK.Input #region public InputDeviceType DeviceType /// - /// Gets a value indicating the InputDeviceType of this InputDevice. + /// Gets a value indicating the InputDeviceType of this InputDevice. /// public InputDeviceType DeviceType { @@ -303,67 +303,5 @@ namespace OpenTK.Input #endregion #endregion - - #region COMPAT_REV1519 - -#if COMPAT_REV1519 - - #region public int WheelDelta - - /// - /// Gets an integer representing the relative wheel movement. - /// - [Obsolete("WheelDelta is only defined for a single WheelChanged event. Use the OpenTK.Input.MouseWheelEventArgs::Delta property with the OpenTK.Input.MouseDevice::WheelChanged event.", false)] - public int WheelDelta - { - get - { - int result = (int)Math.Round(state.WheelPrecise - wheel_last_accessed, MidpointRounding.AwayFromZero); - wheel_last_accessed = state.Wheel; - return result; - } - } - - #endregion - - #region public int XDelta - - /// - /// Gets an integer representing the relative x movement of the pointer, in pixel coordinates. - /// - [Obsolete("XDelta is only defined for a single Move event. Use the OpenTK.Input.MouseMoveEventArgs::Delta property with the OpenTK.Input.MouseDevice::Move event.", false)] - public int XDelta - { - get - { - int result = state.X - pos_last_accessed.X; - pos_last_accessed.X = state.X; - return result; - } - } - - #endregion - - #region public int YDelta - - /// - /// Gets an integer representing the relative y movement of the pointer, in pixel coordinates. - /// - [Obsolete("YDelta is only defined for a single Move event. Use the OpenTK.Input.MouseMoveEventArgs::Delta property with the OpenTK.Input.MouseDevice::Move event.", false)] - public int YDelta - { - get - { - int result = state.Y - pos_last_accessed.Y; - pos_last_accessed.Y = state.Y; - return result; - } - } - - #endregion - -#endif - - #endregion } } diff --git a/src/OpenTK/Math/Functions.cs b/src/OpenTK/Math/Functions.cs deleted file mode 100644 index 15fd0f60..00000000 --- a/src/OpenTK/Math/Functions.cs +++ /dev/null @@ -1,371 +0,0 @@ -#region --- License --- -/* Licensed under the MIT/X11 license. - * Copyright (c) 2006-2008 the OpenTK Team. - * This notice may not be removed from any source distribution. - * See license.txt for licensing detailed licensing details. - * - * Contributions by Andy Gill, James Talton and Georg Wächter. - */ -#endregion - -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenTK -{ - /// - /// Contains mathematical functions for the OpenTK.Math toolkit. - /// - [Obsolete("Use OpenTK.MathHelper instead.")] - public static class Functions - { - #region NextPowerOfTwo - - /// - /// Returns the next power of two that is larger than the specified number. - /// - /// The specified number. - /// The next power of two. - public static long NextPowerOfTwo(long n) - { - if (n < 0) throw new ArgumentOutOfRangeException("n", "Must be positive."); - return (long)System.Math.Pow(2, System.Math.Ceiling(System.Math.Log((double)n, 2))); - } - - /// - /// Returns the next power of two that is larger than the specified number. - /// - /// The specified number. - /// The next power of two. - public static int NextPowerOfTwo(int n) - { - if (n < 0) throw new ArgumentOutOfRangeException("n", "Must be positive."); - return (int)System.Math.Pow(2, System.Math.Ceiling(System.Math.Log((double)n, 2))); - } - - /// - /// Returns the next power of two that is larger than the specified number. - /// - /// The specified number. - /// The next power of two. - public static float NextPowerOfTwo(float n) - { - if (n < 0) throw new ArgumentOutOfRangeException("n", "Must be positive."); - return (float)System.Math.Pow(2, System.Math.Ceiling(System.Math.Log((double)n, 2))); - } - - /// - /// Returns the next power of two that is larger than the specified number. - /// - /// The specified number. - /// The next power of two. - public static double NextPowerOfTwo(double n) - { - if (n < 0) throw new ArgumentOutOfRangeException("n", "Must be positive."); - return System.Math.Pow(2, System.Math.Ceiling(System.Math.Log((double)n, 2))); - } - - #endregion - - #region Factorial - - /// Calculates the factorial of a given natural number. - /// - /// The number. - /// n! - public static long Factorial(int n) - { - long result = 1; - - for (; n > 1; n--) - result *= n; - - return result; - } - - #endregion - - #region BinomialCoefficient - - /// - /// Calculates the binomial coefficient above . - /// - /// The n. - /// The k. - /// n! / (k! * (n - k)!) - public static long BinomialCoefficient(int n, int k) - { - return Factorial(n) / (Factorial(k) * Factorial(n - k)); - } - - #endregion - - #region InverseSqrtFast - - /// - /// Returns an approximation of the inverse square root of left number. - /// - /// A number. - /// An approximation of the inverse square root of the specified number, with an upper error bound of 0.001 - /// - /// This is an improved implementation of the the method known as Carmack's inverse square root - /// which is found in the Quake III source code. This implementation comes from - /// http://www.codemaestro.com/reviews/review00000105.html. For the history of this method, see - /// http://www.beyond3d.com/content/articles/8/ - /// - public static float InverseSqrtFast(float x) - { - unsafe - { - float xhalf = 0.5f * x; - int i = *(int*)&x; // Read bits as integer. - i = 0x5f375a86 - (i >> 1); // Make an initial guess for Newton-Raphson approximation - x = *(float*)&i; // Convert bits back to float - x = x * (1.5f - xhalf * x * x); // Perform left single Newton-Raphson step. - return x; - } - } - - /// - /// Returns an approximation of the inverse square root of left number. - /// - /// A number. - /// An approximation of the inverse square root of the specified number, with an upper error bound of 0.001 - /// - /// This is an improved implementation of the the method known as Carmack's inverse square root - /// which is found in the Quake III source code. This implementation comes from - /// http://www.codemaestro.com/reviews/review00000105.html. For the history of this method, see - /// http://www.beyond3d.com/content/articles/8/ - /// - public static double InverseSqrtFast(double x) - { - return InverseSqrtFast((float)x); - // TODO: The following code is wrong. Fix it, to improve precision. -#if false - unsafe - { - double xhalf = 0.5f * x; - int i = *(int*)&x; // Read bits as integer. - i = 0x5f375a86 - (i >> 1); // Make an initial guess for Newton-Raphson approximation - x = *(float*)&i; // Convert bits back to float - x = x * (1.5f - xhalf * x * x); // Perform left single Newton-Raphson step. - return x; - } -#endif - } - - #endregion - - #region DegreesToRadians - - /// - /// Convert degrees to radians - /// - /// An angle in degrees - /// The angle expressed in radians - public static float DegreesToRadians(float degrees) - { - const float degToRad = (float)System.Math.PI / 180.0f; - return degrees * degToRad; - } - - /// - /// Convert radians to degrees - /// - /// An angle in radians - /// The angle expressed in degrees - public static float RadiansToDegrees(float radians) - { - const float radToDeg = 180.0f / (float)System.Math.PI; - return radians * radToDeg; - } - - #endregion - - #region Mathematical constants - - /// - /// Obsolete. Do not use. - /// - public static readonly float PIF = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930382f; - - /// - /// Obsolete. Do not use. - /// - public static readonly float RTODF = 180.0f / PIF; - - /// - /// Obsolete. Do not use. - /// - public static readonly float DTORF = PIF / 180.0f; - - /// - /// Obsolete. Do not use. - /// - public static readonly double PI = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930382d; - - /// - /// Obsolete. Do not use. - /// - public static readonly double RTOD = 180.0d / PIF; - - /// - /// Obsolete. Do not use. - /// - public static readonly double DTOR = PIF / 180.0d; - - #endregion - - #region Swap - - /// - /// Swaps two float values. - /// - /// The first value. - /// The second value. - public static void Swap(ref double a, ref double b) - { - double temp = a; - a = b; - b = temp; - } - - /// - /// Swaps two float values. - /// - /// The first value. - /// The second value. - public static void Swap(ref float a, ref float b) - { - float temp = a; - a = b; - b = temp; - } - - #endregion - } - -#if false - public static partial class Math - { - #region --- Vectors --- - - #region --- Addition --- - - /// - /// Adds the given Vector2 to the current Vector3. - /// - /// The right operand of the addition. - /// A new Vector3 containing the result of the addition. - public static Vector2 Add(Vector2 left, Vector2 right) - { - return new Vector2(left).Add(right); - } - - /// - /// Adds the given Vector3 to the current Vector3. - /// - /// The right operand of the addition. - /// A new Vector3 containing the result of the addition. - public static Vector3 Add(Vector2 left, Vector3 right) - { - return new Vector3(left).Add(right); - } - - /// - /// Adds the given Vector4 to the current Vector3. W-coordinate remains unaffected. - /// - /// The right operand of the addition. - /// A new Vector4 containing the result of the addition. - public static Vector4 Add(Vector2 left, Vector4 right) - { - return new Vector4(left).Add(right); - } - - /// - /// Adds the given Vector2 to the current Vector3. - /// - /// The right operand of the addition. - /// A new Vector3 containing the result of the addition. - public static Vector3 Add(Vector3 left, Vector2 right) - { - return new Vector3(left).Add(right); - } - - /// - /// Adds the given Vector3 to the current Vector3. - /// - /// The right operand of the addition. - /// A new Vector3 containing the result of the addition. - public static Vector3 Add(Vector3 left, Vector3 right) - { - return new Vector3(left).Add(right); - } - - /// - /// Adds the given Vector4 to the current Vector3. W-coordinate remains unaffected. - /// - /// The right operand of the addition. - /// A new Vector4 containing the result of the addition. - public static Vector4 Add(Vector3 left, Vector4 right) - { - return new Vector4(left).Add(right); - } - - /// - /// Adds the given Vector2 to the current Vector3. - /// - /// The right operand of the addition. - /// A new Vector3 containing the result of the addition. - public static Vector4 Add(Vector4 left, Vector2 right) - { - return new Vector4(left).Add(right); - } - - /// - /// Adds the given Vector3 to the current Vector3. - /// - /// The right operand of the addition. - /// A new Vector3 containing the result of the addition. - public static Vector4 Add(Vector4 left, Vector3 right) - { - return new Vector4(left).Add(right); - } - - /// - /// Adds the given Vector4 to the current Vector3. W-coordinate remains unaffected. - /// - /// The right operand of the addition. - /// A new Vector4 containing the result of the addition. - public static Vector4 Add(Vector4 left, Vector4 right) - { - return new Vector4(left).Add(right); - } - - #endregion - - #region --- Subtraction --- - - - - #endregion - - #region --- Cross --- - - /// - /// Computes the cross product between the current and the given Vector3. The current Vector3 is set to the result of the computation. - /// - /// The right operand of the cross product - /// The current - public static Vector3 Cross(Vector3 left, Vector3 right) - { - return new Vector3(left).Cross(right); - } - - #endregion - - #endregion - } -#endif -} diff --git a/src/OpenTK/Math/Matrix4.cs b/src/OpenTK/Math/Matrix4.cs index e0fd23ce..e70dc089 100644 --- a/src/OpenTK/Math/Matrix4.cs +++ b/src/OpenTK/Math/Matrix4.cs @@ -56,7 +56,7 @@ namespace OpenTK /// Bottom row of the matrix. /// public Vector4 Row3; - + /// /// The identity matrix. /// @@ -284,7 +284,7 @@ namespace OpenTK /// Gets or sets the value at row 4, column 4 of this instance. /// public float M44 { get { return Row3.W; } set { Row3.W = value; } } - + /// /// Gets or sets the values along the main diagonal of the matrix. /// @@ -525,9 +525,9 @@ namespace OpenTK #endregion #region Static - + #region CreateFromAxisAngle - + /// /// Build a rotation matrix from the specified axis/angle rotation. /// @@ -571,7 +571,7 @@ namespace OpenTK result.Row2.W = 0; result.Row3 = Vector4.UnitW; } - + /// /// Build a rotation matrix from the specified axis/angle rotation. /// @@ -584,7 +584,7 @@ namespace OpenTK CreateFromAxisAngle(axis, angle, out result); return result; } - + #endregion #region CreateFromQuaternion @@ -927,9 +927,9 @@ namespace OpenTK } #endregion - + #region CreatePerspectiveFieldOfView - + /// /// Creates a perspective projection matrix. /// @@ -958,7 +958,7 @@ namespace OpenTK throw new ArgumentOutOfRangeException("zNear"); if (zFar <= 0) throw new ArgumentOutOfRangeException("zFar"); - + float yMax = zNear * (float)System.Math.Tan(0.5f * fovy); float yMin = -yMax; float xMin = yMin * aspect; @@ -966,7 +966,7 @@ namespace OpenTK CreatePerspectiveOffCenter(xMin, xMax, yMin, yMax, zNear, zFar, out result); } - + /// /// Creates a perspective projection matrix. /// @@ -991,11 +991,11 @@ namespace OpenTK CreatePerspectiveFieldOfView(fovy, aspect, zNear, zFar, out result); return result; } - + #endregion - + #region CreatePerspectiveOffCenter - + /// /// Creates an perspective projection matrix. /// @@ -1022,7 +1022,7 @@ namespace OpenTK throw new ArgumentOutOfRangeException("zFar"); if (zNear >= zFar) throw new ArgumentOutOfRangeException("zNear"); - + float x = (2.0f * zNear) / (right - left); float y = (2.0f * zNear) / (top - bottom); float a = (right + left) / (right - left); @@ -1047,7 +1047,7 @@ namespace OpenTK result.Row3.Z = d; result.Row3.W = 0; } - + /// /// Creates an perspective projection matrix. /// @@ -1075,187 +1075,6 @@ namespace OpenTK #endregion - #region Obsolete Functions - - #region Translation Functions - - /// - /// Builds a translation matrix. - /// - /// The translation vector. - /// A new Matrix4 instance. - [Obsolete("Use CreateTranslation instead.")] - public static Matrix4 Translation(Vector3 trans) - { - return CreateTranslation(trans); - } - - /// - /// Build a translation matrix with the given translation - /// - /// X translation - /// Y translation - /// Z translation - /// A Translation matrix - [Obsolete("Use CreateTranslation instead.")] - public static Matrix4 Translation(float x, float y, float z) - { - return CreateTranslation(x, y, z); - } - - #endregion - - #region Rotation Functions - - /// - /// Build a rotation matrix that rotates about the x-axis - /// - /// angle in radians to rotate counter-clockwise around the x-axis - /// A rotation matrix - [Obsolete("Use CreateRotationX instead.")] - public static Matrix4 RotateX(float angle) - { - return CreateRotationX(angle); - } - - /// - /// Build a rotation matrix that rotates about the y-axis - /// - /// angle in radians to rotate counter-clockwise around the y-axis - /// A rotation matrix - [Obsolete("Use CreateRotationY instead.")] - public static Matrix4 RotateY(float angle) - { - return CreateRotationY(angle); - } - - /// - /// Build a rotation matrix that rotates about the z-axis - /// - /// angle in radians to rotate counter-clockwise around the z-axis - /// A rotation matrix - [Obsolete("Use CreateRotationZ instead.")] - public static Matrix4 RotateZ(float angle) - { - return CreateRotationZ(angle); - } - - /// - /// Build a rotation matrix to rotate about the given axis - /// - /// the axis to rotate about - /// angle in radians to rotate counter-clockwise (looking in the direction of the given axis) - /// A rotation matrix - [Obsolete("Use CreateFromAxisAngle instead.")] - public static Matrix4 Rotate(Vector3 axis, float angle) - { - return CreateFromAxisAngle(axis, angle); - } - - /// - /// Build a rotation matrix from a quaternion - /// - /// the quaternion - /// A rotation matrix - [Obsolete("Use CreateFromQuaternion instead.")] - public static Matrix4 Rotate(Quaternion q) - { - return CreateFromQuaternion(q); - } - - #endregion - - #region Scale Functions - - /// - /// Build a scaling matrix - /// - /// Single scale factor for x,y and z axes - /// A scaling matrix - [Obsolete("Use CreateScale instead.")] - public static Matrix4 Scale(float scale) - { - return Scale(scale, scale, scale); - } - - /// - /// Build a scaling matrix - /// - /// Scale factors for x,y and z axes - /// A scaling matrix - [Obsolete("Use CreateScale instead.")] - public static Matrix4 Scale(Vector3 scale) - { - return Scale(scale.X, scale.Y, scale.Z); - } - - /// - /// Build a scaling matrix - /// - /// Scale factor for x-axis - /// Scale factor for y-axis - /// Scale factor for z-axis - /// A scaling matrix - [Obsolete("Use CreateScale instead.")] - public static Matrix4 Scale(float x, float y, float z) - { - Matrix4 result; - result.Row0 = Vector4.UnitX * x; - result.Row1 = Vector4.UnitY * y; - result.Row2 = Vector4.UnitZ * z; - result.Row3 = Vector4.UnitW; - return result; - } - - #endregion - - #region Camera Helper Functions - - /// - /// Build a projection matrix - /// - /// Left edge of the view frustum - /// Right edge of the view frustum - /// Bottom edge of the view frustum - /// Top edge of the view frustum - /// Distance to the near clip plane - /// Distance to the far clip plane - /// A projection matrix that transforms camera space to raster space - [Obsolete("Use CreatePerspectiveOffCenter instead.")] - public static Matrix4 Frustum(float left, float right, float bottom, float top, float near, float far) - { - float invRL = 1.0f / (right - left); - float invTB = 1.0f / (top - bottom); - float invFN = 1.0f / (far - near); - return new Matrix4(new Vector4(2.0f * near * invRL, 0.0f, 0.0f, 0.0f), - new Vector4(0.0f, 2.0f * near * invTB, 0.0f, 0.0f), - new Vector4((right + left) * invRL, (top + bottom) * invTB, -(far + near) * invFN, -1.0f), - new Vector4(0.0f, 0.0f, -2.0f * far * near * invFN, 0.0f)); - } - - /// - /// Build a projection matrix - /// - /// Angle of the field of view in the y direction (in radians) - /// Aspect ratio of the view (width / height) - /// Distance to the near clip plane - /// Distance to the far clip plane - /// A projection matrix that transforms camera space to raster space - [Obsolete("Use CreatePerspectiveFieldOfView instead.")] - public static Matrix4 Perspective(float fovy, float aspect, float near, float far) - { - float yMax = near * (float)System.Math.Tan(0.5f * fovy); - float yMin = -yMax; - float xMin = yMin * aspect; - float xMax = yMax * aspect; - - return Frustum(xMin, xMax, yMin, yMax, near, far); - } - - #endregion - - #endregion - #region Camera Helper Functions /// @@ -1469,9 +1288,9 @@ namespace OpenTK int[] pivotIdx = { -1, -1, -1, -1 }; // convert the matrix to an array for easy looping - float[,] inverse = {{mat.Row0.X, mat.Row0.Y, mat.Row0.Z, mat.Row0.W}, - {mat.Row1.X, mat.Row1.Y, mat.Row1.Z, mat.Row1.W}, - {mat.Row2.X, mat.Row2.Y, mat.Row2.Z, mat.Row2.W}, + float[,] inverse = {{mat.Row0.X, mat.Row0.Y, mat.Row0.Z, mat.Row0.W}, + {mat.Row1.X, mat.Row1.Y, mat.Row1.Z, mat.Row1.W}, + {mat.Row2.X, mat.Row2.Y, mat.Row2.Z, mat.Row2.W}, {mat.Row3.X, mat.Row3.Y, mat.Row3.Z, mat.Row3.W} }; int icol = 0; int irow = 0; diff --git a/src/OpenTK/Math/Matrix4d.cs b/src/OpenTK/Math/Matrix4d.cs index db194b3f..6db03283 100644 --- a/src/OpenTK/Math/Matrix4d.cs +++ b/src/OpenTK/Math/Matrix4d.cs @@ -53,7 +53,7 @@ namespace OpenTK /// Bottom row of the matrix /// public Vector4d Row3; - + /// /// The identity matrix /// @@ -958,114 +958,6 @@ namespace OpenTK CreateFromQuaternion(ref q, out result); return result; } - - - /// - /// Build a rotation matrix from the specified quaternion. - /// - /// Quaternion to translate. - /// Matrix result. - [Obsolete("Use double-precision overload instead")] - public static void CreateFromQuaternion(ref Quaternion q,ref Matrix4 m) - { - m = Matrix4.Identity; - - float X = q.X; - float Y = q.Y; - float Z = q.Z; - float W = q.W; - - float xx = X * X; - float xy = X * Y; - float xz = X * Z; - float xw = X * W; - float yy = Y * Y; - float yz = Y * Z; - float yw = Y * W; - float zz = Z * Z; - float zw = Z * W; - - m.M11 = 1 - 2 * (yy + zz); - m.M21 = 2 * (xy - zw); - m.M31 = 2 * (xz + yw); - m.M12 = 2 * (xy + zw); - m.M22 = 1 - 2 * (xx + zz); - m.M32 = 2 * (yz - xw); - m.M13 = 2 * (xz - yw); - m.M23 = 2 * (yz + xw); - m.M33 = 1 - 2 * (xx + yy); - } - - /// - /// Build a rotation matrix from the specified quaternion. - /// - /// Quaternion to translate. - /// A matrix instance. - [Obsolete("Use double-precision overload instead")] - public static Matrix4 CreateFromQuaternion(ref Quaternion q) - { - Matrix4 result = Matrix4.Identity; - - float X = q.X; - float Y = q.Y; - float Z = q.Z; - float W = q.W; - - float xx = X * X; - float xy = X * Y; - float xz = X * Z; - float xw = X * W; - float yy = Y * Y; - float yz = Y * Z; - float yw = Y * W; - float zz = Z * Z; - float zw = Z * W; - - result.M11 = 1 - 2 * (yy + zz); - result.M21 = 2 * (xy - zw); - result.M31 = 2 * (xz + yw); - result.M12 = 2 * (xy + zw); - result.M22 = 1 - 2 * (xx + zz); - result.M32 = 2 * (yz - xw); - result.M13 = 2 * (xz - yw); - result.M23 = 2 * (yz + xw); - result.M33 = 1 - 2 * (xx + yy); - return result; - } - - #endregion - - #region Obsolete Functions - - #region Translation Functions - - /// - /// Build a translation matrix with the given translation - /// - /// The vector to translate along - /// A Translation matrix - [Obsolete("Use CreateTranslation instead.")] - public static Matrix4d Translation(Vector3d trans) - { - return Translation(trans.X, trans.Y, trans.Z); - } - - /// - /// Build a translation matrix with the given translation - /// - /// X translation - /// Y translation - /// Z translation - /// A Translation matrix - [Obsolete("Use CreateTranslation instead.")] - public static Matrix4d Translation(double x, double y, double z) - { - Matrix4d result = Identity; - result.Row3 = new Vector4d(x, y, z, 1.0); - return result; - } - - #endregion #endregion @@ -1443,9 +1335,9 @@ namespace OpenTK int[] pivotIdx = { -1, -1, -1, -1 }; // convert the matrix to an array for easy looping - double[,] inverse = {{mat.Row0.X, mat.Row0.Y, mat.Row0.Z, mat.Row0.W}, - {mat.Row1.X, mat.Row1.Y, mat.Row1.Z, mat.Row1.W}, - {mat.Row2.X, mat.Row2.Y, mat.Row2.Z, mat.Row2.W}, + double[,] inverse = {{mat.Row0.X, mat.Row0.Y, mat.Row0.Z, mat.Row0.W}, + {mat.Row1.X, mat.Row1.Y, mat.Row1.Z, mat.Row1.W}, + {mat.Row2.X, mat.Row2.Y, mat.Row2.Z, mat.Row2.W}, {mat.Row3.X, mat.Row3.Y, mat.Row3.Z, mat.Row3.W} }; int icol = 0; int irow = 0; diff --git a/src/OpenTK/Math/Quaternion.cs b/src/OpenTK/Math/Quaternion.cs index 14bb5089..36b27663 100644 --- a/src/OpenTK/Math/Quaternion.cs +++ b/src/OpenTK/Math/Quaternion.cs @@ -42,7 +42,7 @@ namespace OpenTK /// The X, Y and Z components of this instance. /// public Vector3 Xyz; - + /// /// The W component of this instance. /// @@ -113,19 +113,6 @@ 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. - /// - [Obsolete("Use Xyz property instead.")] - [EditorBrowsable(EditorBrowsableState.Never)] - [XmlIgnore] - [CLSCompliant(false)] - public Vector3 XYZ { get { return Xyz; } set { Xyz = value; } } - - #pragma warning restore 3005 - /// /// Gets or sets the X component of this instance. /// @@ -182,7 +169,7 @@ namespace OpenTK } else { - // This occurs when the angle is zero. + // This occurs when the angle is zero. // Not a problem: just set an arbitrary normalized axis. result.Xyz = Vector3.UnitX; } @@ -350,35 +337,7 @@ namespace OpenTK #endregion - #region Mult - - /// - /// Multiplies two instances. - /// - /// The first instance. - /// The second instance. - /// A new instance containing the result of the calculation. - [Obsolete("Use Multiply instead.")] - public static Quaternion Mult(Quaternion left, Quaternion right) - { - return new Quaternion( - right.W * left.Xyz + left.W * right.Xyz + Vector3.Cross(left.Xyz, right.Xyz), - left.W * right.W - Vector3.Dot(left.Xyz, right.Xyz)); - } - - /// - /// Multiplies two instances. - /// - /// The first instance. - /// The second instance. - /// A new instance containing the result of the calculation. - [Obsolete("Use Multiply instead.")] - public static void Mult(ref Quaternion left, ref Quaternion right, out Quaternion result) - { - result = new Quaternion( - right.W * left.Xyz + left.W * right.Xyz + Vector3.Cross(left.Xyz, right.Xyz), - left.W * right.W - Vector3.Dot(left.Xyz, right.Xyz)); - } + #region Multiply /// /// Multiplies two instances. @@ -662,7 +621,7 @@ namespace OpenTK #region Slerp /// - /// Do Spherical linear interpolation between two quaternions + /// Do Spherical linear interpolation between two quaternions /// /// The first quaternion /// The second quaternion @@ -833,7 +792,7 @@ namespace OpenTK #region public override bool Equals (object o) /// - /// Compares this object instance to another object for equality. + /// Compares this object instance to another object for equality. /// /// The other object to be used in the comparison. /// True if both objects are Quaternions of equal value. Otherwise it returns false. @@ -848,7 +807,7 @@ namespace OpenTK #region public override int GetHashCode () /// - /// Provides the hash code for this object. + /// Provides the hash code for this object. /// /// A hash code formed from the bitwise XOR of this objects members. public override int GetHashCode() @@ -868,7 +827,7 @@ namespace OpenTK #region IEquatable Members /// - /// Compares this Quaternion instance to another Quaternion for equality. + /// Compares this Quaternion instance to another Quaternion for equality. /// /// The other Quaternion to be used in the comparison. /// True if both instances are equal; false otherwise. diff --git a/src/OpenTK/Math/Quaterniond.cs b/src/OpenTK/Math/Quaterniond.cs index 08636e23..7ca5a611 100644 --- a/src/OpenTK/Math/Quaterniond.cs +++ b/src/OpenTK/Math/Quaterniond.cs @@ -45,7 +45,7 @@ namespace OpenTK /// /// The W component of this instance. - /// + /// public double W; #endregion @@ -113,19 +113,6 @@ 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. - /// - [Obsolete("Use Xyz property instead.")] - [CLSCompliant(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - [XmlIgnore] - public Vector3d XYZ { get { return Xyz; } set { Xyz = value; } } - - #pragma warning restore 3005 - /// /// Gets or sets the X component of this instance. /// @@ -143,7 +130,7 @@ namespace OpenTK /// [XmlIgnore] public double Z { get { return Xyz.Z; } set { Xyz.Z = value; } } - + #endregion #region Instance @@ -182,7 +169,7 @@ namespace OpenTK } else { - // This occurs when the angle is zero. + // This occurs when the angle is zero. // Not a problem: just set an arbitrary normalized axis. result.Xyz = Vector3d.UnitX; } @@ -350,35 +337,7 @@ namespace OpenTK #endregion - #region Mult - - /// - /// Multiplies two instances. - /// - /// The first instance. - /// The second instance. - /// A new instance containing the result of the calculation. - [Obsolete("Use Multiply instead.")] - public static Quaterniond Mult(Quaterniond left, Quaterniond right) - { - return new Quaterniond( - right.W * left.Xyz + left.W * right.Xyz + Vector3d.Cross(left.Xyz, right.Xyz), - left.W * right.W - Vector3d.Dot(left.Xyz, right.Xyz)); - } - - /// - /// Multiplies two instances. - /// - /// The first instance. - /// The second instance. - /// A new instance containing the result of the calculation. - [Obsolete("Use Multiply instead.")] - public static void Mult(ref Quaterniond left, ref Quaterniond right, out Quaterniond result) - { - result = new Quaterniond( - right.W * left.Xyz + left.W * right.Xyz + Vector3d.Cross(left.Xyz, right.Xyz), - left.W * right.W - Vector3d.Dot(left.Xyz, right.Xyz)); - } + #region Multiply /// /// Multiplies two instances. @@ -662,7 +621,7 @@ namespace OpenTK #region Slerp /// - /// Do Spherical linear interpolation between two quaternions + /// Do Spherical linear interpolation between two quaternions /// /// The first Quaterniond /// The second Quaterniond @@ -727,7 +686,7 @@ namespace OpenTK #endregion #endregion - + #region Operators /// @@ -833,7 +792,7 @@ namespace OpenTK #region public override bool Equals (object o) /// - /// Compares this object instance to another object for equality. + /// Compares this object instance to another object for equality. /// /// The other object to be used in the comparison. /// True if both objects are Quaternions of equal value. Otherwise it returns false. @@ -848,7 +807,7 @@ namespace OpenTK #region public override int GetHashCode () /// - /// Provides the hash code for this object. + /// Provides the hash code for this object. /// /// A hash code formed from the bitwise XOR of this objects members. @@ -883,7 +842,7 @@ namespace OpenTK public double Z; #endregion - + #region Constructors /// Constructs left Quaterniond that is left copy of the given Quaterniond. @@ -942,11 +901,11 @@ namespace OpenTK public Quaterniond(ref Matrix4d matrix) { double scale = System.Math.Pow(matrix.Determinant, 1.0d/3.0d); - + W = System.Math.Sqrt(System.Math.Max(0, scale + matrix[0, 0] + matrix[1, 1] + matrix[2, 2])) / 2; X = System.Math.Sqrt(System.Math.Max(0, scale + matrix[0, 0] - matrix[1, 1] - matrix[2, 2])) / 2; Y = System.Math.Sqrt(System.Math.Max(0, scale - matrix[0, 0] + matrix[1, 1] - matrix[2, 2])) / 2; - Z = System.Math.Sqrt(System.Math.Max(0, scale - matrix[0, 0] - matrix[1, 1] + matrix[2, 2])) / 2; + Z = System.Math.Sqrt(System.Math.Max(0, scale - matrix[0, 0] - matrix[1, 1] + matrix[2, 2])) / 2; if( matrix[2,1] - matrix[1,2] < 0 ) X = -X; if( matrix[0,2] - matrix[2,0] < 0 ) Y = -Y; if( matrix[1,0] - matrix[0,1] < 0 ) Z = -Z; @@ -1086,7 +1045,7 @@ namespace OpenTK } #endregion - + #region Functions public double Modulus @@ -1429,7 +1388,7 @@ namespace OpenTK } #endregion - + #region HashCode /// Returns the hash code for this instance. @@ -1441,7 +1400,7 @@ namespace OpenTK } #endregion - + #region String and Parse /// Returns the fully qualified type name of this instance. @@ -1466,7 +1425,7 @@ namespace OpenTK } #endregion - + #region Constants /// A quaterion with all zero components. @@ -1494,7 +1453,7 @@ namespace OpenTK #region IEquatable Members /// - /// Compares this Quaterniond instance to another Quaterniond for equality. + /// Compares this Quaterniond instance to another Quaterniond for equality. /// /// The other Quaterniond to be used in the comparison. /// True if both instances are equal; false otherwise. diff --git a/src/OpenTK/Math/Vector2.cs b/src/OpenTK/Math/Vector2.cs index 19287154..dcf58f79 100644 --- a/src/OpenTK/Math/Vector2.cs +++ b/src/OpenTK/Math/Vector2.cs @@ -73,39 +73,6 @@ namespace OpenTK Y = y; } - /// - /// Constructs a new Vector2 from the given Vector2. - /// - /// The Vector2 to copy components from. - [Obsolete] - public Vector2(Vector2 v) - { - X = v.X; - Y = v.Y; - } - - /// - /// Constructs a new Vector2 from the given Vector3. - /// - /// The Vector3 to copy components from. Z is discarded. - [Obsolete] - public Vector2(Vector3 v) - { - X = v.X; - Y = v.Y; - } - - /// - /// Constructs a new Vector2 from the given Vector4. - /// - /// The Vector4 to copy components from. Z and W are discarded. - [Obsolete] - public Vector2(Vector4 v) - { - X = v.X; - Y = v.Y; - } - #endregion #region Public Members @@ -127,81 +94,6 @@ namespace OpenTK #region Instance - #region public void Add() - - /// Add the Vector passed as parameter to this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Add() method instead.")] - public void Add(Vector2 right) - { - this.X += right.X; - this.Y += right.Y; - } - - /// Add the Vector passed as parameter to this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Add() method instead.")] - public void Add(ref Vector2 right) - { - this.X += right.X; - this.Y += right.Y; - } - - #endregion public void Add() - - #region public void Sub() - - /// Subtract the Vector passed as parameter from this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Subtract() method instead.")] - public void Sub(Vector2 right) - { - this.X -= right.X; - this.Y -= right.Y; - } - - /// Subtract the Vector passed as parameter from this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Subtract() method instead.")] - public void Sub(ref Vector2 right) - { - this.X -= right.X; - this.Y -= right.Y; - } - - #endregion public void Sub() - - #region public void Mult() - - /// Multiply this instance by a scalar. - /// Scalar operand. - [Obsolete("Use static Multiply() method instead.")] - public void Mult(float f) - { - this.X *= f; - this.Y *= f; - } - - #endregion public void Mult() - - #region public void Div() - - /// Divide this instance by a scalar. - /// Scalar operand. - [Obsolete("Use static Divide() method instead.")] - public void Div(float f) - { - float mult = 1.0f / f; - this.X *= mult; - this.Y *= mult; - } - - #endregion public void Div() - #region public float Length /// @@ -329,42 +221,6 @@ namespace OpenTK #endregion - #region public void Scale() - - /// - /// Scales the current Vector2 by the given amounts. - /// - /// The scale of the X component. - /// The scale of the Y component. - [Obsolete("Use static Multiply() method instead.")] - public void Scale(float sx, float sy) - { - this.X = X * sx; - this.Y = Y * sy; - } - - /// Scales this instance by the given parameter. - /// The scaling of the individual components. - [CLSCompliant(false)] - [Obsolete("Use static Multiply() method instead.")] - public void Scale(Vector2 scale) - { - this.X *= scale.X; - this.Y *= scale.Y; - } - - /// Scales this instance by the given parameter. - /// The scaling of the individual components. - [CLSCompliant(false)] - [Obsolete("Use static Multiply() method instead.")] - public void Scale(ref Vector2 scale) - { - this.X *= scale.X; - this.Y *= scale.Y; - } - - #endregion public void Scale() - #endregion #region Static @@ -398,105 +254,6 @@ namespace OpenTK #endregion - #region Obsolete - - #region Sub - - /// - /// Subtract one Vector from another - /// - /// First operand - /// Second operand - /// Result of subtraction - [Obsolete("Use static Subtract() method instead.")] - public static Vector2 Sub(Vector2 a, Vector2 b) - { - a.X -= b.X; - a.Y -= b.Y; - return a; - } - - /// - /// Subtract one Vector from another - /// - /// First operand - /// Second operand - /// Result of subtraction - [Obsolete("Use static Subtract() method instead.")] - public static void Sub(ref Vector2 a, ref Vector2 b, out Vector2 result) - { - result.X = a.X - b.X; - result.Y = a.Y - b.Y; - } - - #endregion - - #region Mult - - /// - /// Multiply a vector and a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the multiplication - [Obsolete("Use static Multiply() method instead.")] - public static Vector2 Mult(Vector2 a, float f) - { - a.X *= f; - a.Y *= f; - return a; - } - - /// - /// Multiply a vector and a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the multiplication - [Obsolete("Use static Multiply() method instead.")] - public static void Mult(ref Vector2 a, float f, out Vector2 result) - { - result.X = a.X * f; - result.Y = a.Y * f; - } - - #endregion - - #region Div - - /// - /// Divide a vector by a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the division - [Obsolete("Use static Divide() method instead.")] - public static Vector2 Div(Vector2 a, float f) - { - float mult = 1.0f / f; - a.X *= mult; - a.Y *= mult; - return a; - } - - /// - /// Divide a vector by a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the division - [Obsolete("Use static Divide() method instead.")] - public static void Div(ref Vector2 a, float f, out Vector2 result) - { - float mult = 1.0f / f; - result.X = a.X * mult; - result.Y = a.Y * mult; - } - - #endregion - - #endregion - #region Add /// diff --git a/src/OpenTK/Math/Vector2d.cs b/src/OpenTK/Math/Vector2d.cs index 712b4714..bc45b8bf 100644 --- a/src/OpenTK/Math/Vector2d.cs +++ b/src/OpenTK/Math/Vector2d.cs @@ -110,81 +110,6 @@ namespace OpenTK #region Instance - #region public void Add() - - /// Add the Vector passed as parameter to this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Add() method instead.")] - public void Add(Vector2d right) - { - this.X += right.X; - this.Y += right.Y; - } - - /// Add the Vector passed as parameter to this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Add() method instead.")] - public void Add(ref Vector2d right) - { - this.X += right.X; - this.Y += right.Y; - } - - #endregion public void Add() - - #region public void Sub() - - /// Subtract the Vector passed as parameter from this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Subtract() method instead.")] - public void Sub(Vector2d right) - { - this.X -= right.X; - this.Y -= right.Y; - } - - /// Subtract the Vector passed as parameter from this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Subtract() method instead.")] - public void Sub(ref Vector2d right) - { - this.X -= right.X; - this.Y -= right.Y; - } - - #endregion public void Sub() - - #region public void Mult() - - /// Multiply this instance by a scalar. - /// Scalar operand. - [Obsolete("Use static Multiply() method instead.")] - public void Mult(double f) - { - this.X *= f; - this.Y *= f; - } - - #endregion public void Mult() - - #region public void Div() - - /// Divide this instance by a scalar. - /// Scalar operand. - [Obsolete("Use static Divide() method instead.")] - public void Div(double f) - { - double mult = 1.0 / f; - this.X *= mult; - this.Y *= mult; - } - - #endregion public void Div() - #region public double Length /// @@ -276,145 +201,6 @@ namespace OpenTK #endregion - #region public void Scale() - - /// - /// Scales the current Vector2 by the given amounts. - /// - /// The scale of the X component. - /// The scale of the Y component. - [Obsolete("Use static Multiply() method instead.")] - public void Scale(double sx, double sy) - { - X *= sx; - Y *= sy; - } - - /// Scales this instance by the given parameter. - /// The scaling of the individual components. - [CLSCompliant(false)] - [Obsolete("Use static Multiply() method instead.")] - public void Scale(Vector2d scale) - { - this.X *= scale.X; - this.Y *= scale.Y; - } - - /// Scales this instance by the given parameter. - /// The scaling of the individual components. - [CLSCompliant(false)] - [Obsolete("Use static Multiply() method instead.")] - public void Scale(ref Vector2d scale) - { - this.X *= scale.X; - this.Y *= scale.Y; - } - - #endregion public void Scale() - - #endregion - - #region Static - - #region Obsolete - - #region Sub - - /// - /// Subtract one Vector from another - /// - /// First operand - /// Second operand - /// Result of subtraction - [Obsolete("Use static Subtract() method instead.")] - public static Vector2d Sub(Vector2d a, Vector2d b) - { - a.X -= b.X; - a.Y -= b.Y; - return a; - } - - /// - /// Subtract one Vector from another - /// - /// First operand - /// Second operand - /// Result of subtraction - [Obsolete("Use static Subtract() method instead.")] - public static void Sub(ref Vector2d a, ref Vector2d b, out Vector2d result) - { - result.X = a.X - b.X; - result.Y = a.Y - b.Y; - } - - #endregion - - #region Mult - - /// - /// Multiply a vector and a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the multiplication - [Obsolete("Use static Multiply() method instead.")] - public static Vector2d Mult(Vector2d a, double d) - { - a.X *= d; - a.Y *= d; - return a; - } - - /// - /// Multiply a vector and a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the multiplication - [Obsolete("Use static Multiply() method instead.")] - public static void Mult(ref Vector2d a, double d, out Vector2d result) - { - result.X = a.X * d; - result.Y = a.Y * d; - } - - #endregion - - #region Div - - /// - /// Divide a vector by a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the division - [Obsolete("Use static Divide() method instead.")] - public static Vector2d Div(Vector2d a, double d) - { - double mult = 1.0 / d; - a.X *= mult; - a.Y *= mult; - return a; - } - - /// - /// Divide a vector by a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the division - [Obsolete("Use static Divide() method instead.")] - public static void Div(ref Vector2d a, double d, out Vector2d result) - { - double mult = 1.0 / d; - result.X = a.X * mult; - result.Y = a.Y * mult; - } - - #endregion - - #endregion - #region Add /// diff --git a/src/OpenTK/Math/Vector3.cs b/src/OpenTK/Math/Vector3.cs index 510ae63e..1ac4d7c1 100644 --- a/src/OpenTK/Math/Vector3.cs +++ b/src/OpenTK/Math/Vector3.cs @@ -140,87 +140,6 @@ namespace OpenTK #region Instance - #region public void Add() - - /// Add the Vector passed as parameter to this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Add() method instead.")] - public void Add(Vector3 right) - { - this.X += right.X; - this.Y += right.Y; - this.Z += right.Z; - } - - /// Add the Vector passed as parameter to this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Add() method instead.")] - public void Add(ref Vector3 right) - { - this.X += right.X; - this.Y += right.Y; - this.Z += right.Z; - } - - #endregion public void Add() - - #region public void Sub() - - /// Subtract the Vector passed as parameter from this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Subtract() method instead.")] - public void Sub(Vector3 right) - { - this.X -= right.X; - this.Y -= right.Y; - this.Z -= right.Z; - } - - /// Subtract the Vector passed as parameter from this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Subtract() method instead.")] - public void Sub(ref Vector3 right) - { - this.X -= right.X; - this.Y -= right.Y; - this.Z -= right.Z; - } - - #endregion public void Sub() - - #region public void Mult() - - /// Multiply this instance by a scalar. - /// Scalar operand. - [Obsolete("Use static Multiply() method instead.")] - public void Mult(float f) - { - this.X *= f; - this.Y *= f; - this.Z *= f; - } - - #endregion public void Mult() - - #region public void Div() - - /// Divide this instance by a scalar. - /// Scalar operand. - [Obsolete("Use static Divide() method instead.")] - public void Div(float f) - { - float mult = 1.0f / f; - this.X *= mult; - this.Y *= mult; - this.Z *= mult; - } - - #endregion public void Div() - #region public float Length /// @@ -320,46 +239,6 @@ namespace OpenTK #endregion - #region public void Scale() - - /// - /// Scales the current Vector3 by the given amounts. - /// - /// The scale of the X component. - /// The scale of the Y component. - /// The scale of the Z component. - [Obsolete("Use static Multiply() method instead.")] - public void Scale(float sx, float sy, float sz) - { - this.X = X * sx; - this.Y = Y * sy; - this.Z = Z * sz; - } - - /// Scales this instance by the given parameter. - /// The scaling of the individual components. - [CLSCompliant(false)] - [Obsolete("Use static Multiply() method instead.")] - public void Scale(Vector3 scale) - { - this.X *= scale.X; - this.Y *= scale.Y; - this.Z *= scale.Z; - } - - /// Scales this instance by the given parameter. - /// The scaling of the individual components. - [CLSCompliant(false)] - [Obsolete("Use static Multiply() method instead.")] - public void Scale(ref Vector3 scale) - { - this.X *= scale.X; - this.Y *= scale.Y; - this.Z *= scale.Z; - } - - #endregion public void Scale() - #endregion #region Static @@ -398,111 +277,6 @@ namespace OpenTK #endregion - #region Obsolete - - #region Sub - - /// - /// Subtract one Vector from another - /// - /// First operand - /// Second operand - /// Result of subtraction - [Obsolete("Use static Subtract() method instead.")] - public static Vector3 Sub(Vector3 a, Vector3 b) - { - a.X -= b.X; - a.Y -= b.Y; - a.Z -= b.Z; - return a; - } - - /// - /// Subtract one Vector from another - /// - /// First operand - /// Second operand - /// Result of subtraction - [Obsolete("Use static Subtract() method instead.")] - public static void Sub(ref Vector3 a, ref Vector3 b, out Vector3 result) - { - result.X = a.X - b.X; - result.Y = a.Y - b.Y; - result.Z = a.Z - b.Z; - } - - #endregion - - #region Mult - - /// - /// Multiply a vector and a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the multiplication - [Obsolete("Use static Multiply() method instead.")] - public static Vector3 Mult(Vector3 a, float f) - { - a.X *= f; - a.Y *= f; - a.Z *= f; - return a; - } - - /// - /// Multiply a vector and a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the multiplication - [Obsolete("Use static Multiply() method instead.")] - public static void Mult(ref Vector3 a, float f, out Vector3 result) - { - result.X = a.X * f; - result.Y = a.Y * f; - result.Z = a.Z * f; - } - - #endregion - - #region Div - - /// - /// Divide a vector by a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the division - [Obsolete("Use static Divide() method instead.")] - public static Vector3 Div(Vector3 a, float f) - { - float mult = 1.0f / f; - a.X *= mult; - a.Y *= mult; - a.Z *= mult; - return a; - } - - /// - /// Divide a vector by a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the division - [Obsolete("Use static Divide() method instead.")] - public static void Div(ref Vector3 a, float f, out Vector3 result) - { - float mult = 1.0f / f; - result.X = a.X * mult; - result.Y = a.Y * mult; - result.Z = a.Z * mult; - } - - #endregion - - #endregion - #region Add /// diff --git a/src/OpenTK/Math/Vector3d.cs b/src/OpenTK/Math/Vector3d.cs index aab85e7d..0a57a412 100644 --- a/src/OpenTK/Math/Vector3d.cs +++ b/src/OpenTK/Math/Vector3d.cs @@ -137,87 +137,6 @@ namespace OpenTK #region Instance - #region public void Add() - - /// Add the Vector passed as parameter to this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Add() method instead.")] - public void Add(Vector3d right) - { - this.X += right.X; - this.Y += right.Y; - this.Z += right.Z; - } - - /// Add the Vector passed as parameter to this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Add() method instead.")] - public void Add(ref Vector3d right) - { - this.X += right.X; - this.Y += right.Y; - this.Z += right.Z; - } - - #endregion public void Add() - - #region public void Sub() - - /// Subtract the Vector passed as parameter from this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Subtract() method instead.")] - public void Sub(Vector3d right) - { - this.X -= right.X; - this.Y -= right.Y; - this.Z -= right.Z; - } - - /// Subtract the Vector passed as parameter from this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Subtract() method instead.")] - public void Sub(ref Vector3d right) - { - this.X -= right.X; - this.Y -= right.Y; - this.Z -= right.Z; - } - - #endregion public void Sub() - - #region public void Mult() - - /// Multiply this instance by a scalar. - /// Scalar operand. - [Obsolete("Use static Multiply() method instead.")] - public void Mult(double f) - { - this.X *= f; - this.Y *= f; - this.Z *= f; - } - - #endregion public void Mult() - - #region public void Div() - - /// Divide this instance by a scalar. - /// Scalar operand. - [Obsolete("Use static Divide() method instead.")] - public void Div(double f) - { - double mult = 1.0 / f; - this.X *= mult; - this.Y *= mult; - this.Z *= mult; - } - - #endregion public void Div() - #region public double Length /// @@ -318,46 +237,6 @@ namespace OpenTK #endregion - #region public void Scale() - - /// - /// Scales the current Vector3d by the given amounts. - /// - /// The scale of the X component. - /// The scale of the Y component. - /// The scale of the Z component. - [Obsolete("Use static Multiply() method instead.")] - public void Scale(double sx, double sy, double sz) - { - this.X = X * sx; - this.Y = Y * sy; - this.Z = Z * sz; - } - - /// Scales this instance by the given parameter. - /// The scaling of the individual components. - [Obsolete("Use static Multiply() method instead.")] - [CLSCompliant(false)] - public void Scale(Vector3d scale) - { - this.X *= scale.X; - this.Y *= scale.Y; - this.Z *= scale.Z; - } - - /// Scales this instance by the given parameter. - /// The scaling of the individual components. - [Obsolete("Use static Multiply() method instead.")] - [CLSCompliant(false)] - public void Scale(ref Vector3d scale) - { - this.X *= scale.X; - this.Y *= scale.Y; - this.Z *= scale.Z; - } - - #endregion public void Scale() - #endregion #region Static @@ -396,111 +275,6 @@ namespace OpenTK #endregion - #region Obsolete - - #region Sub - - /// - /// Subtract one Vector from another - /// - /// First operand - /// Second operand - /// Result of subtraction - [Obsolete("Use static Subtract() method instead.")] - public static Vector3d Sub(Vector3d a, Vector3d b) - { - a.X -= b.X; - a.Y -= b.Y; - a.Z -= b.Z; - return a; - } - - /// - /// Subtract one Vector from another - /// - /// First operand - /// Second operand - /// Result of subtraction - [Obsolete("Use static Subtract() method instead.")] - public static void Sub(ref Vector3d a, ref Vector3d b, out Vector3d result) - { - result.X = a.X - b.X; - result.Y = a.Y - b.Y; - result.Z = a.Z - b.Z; - } - - #endregion - - #region Mult - - /// - /// Multiply a vector and a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the multiplication - [Obsolete("Use static Multiply() method instead.")] - public static Vector3d Mult(Vector3d a, double f) - { - a.X *= f; - a.Y *= f; - a.Z *= f; - return a; - } - - /// - /// Multiply a vector and a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the multiplication - [Obsolete("Use static Multiply() method instead.")] - public static void Mult(ref Vector3d a, double f, out Vector3d result) - { - result.X = a.X * f; - result.Y = a.Y * f; - result.Z = a.Z * f; - } - - #endregion - - #region Div - - /// - /// Divide a vector by a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the division - [Obsolete("Use static Divide() method instead.")] - public static Vector3d Div(Vector3d a, double f) - { - double mult = 1.0 / f; - a.X *= mult; - a.Y *= mult; - a.Z *= mult; - return a; - } - - /// - /// Divide a vector by a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the division - [Obsolete("Use static Divide() method instead.")] - public static void Div(ref Vector3d a, double f, out Vector3d result) - { - double mult = 1.0 / f; - result.X = a.X * mult; - result.Y = a.Y * mult; - result.Z = a.Z * mult; - } - - #endregion - - #endregion - #region Add /// diff --git a/src/OpenTK/Math/Vector4.cs b/src/OpenTK/Math/Vector4.cs index 42dc6beb..cc16503d 100644 --- a/src/OpenTK/Math/Vector4.cs +++ b/src/OpenTK/Math/Vector4.cs @@ -200,93 +200,6 @@ namespace OpenTK #region Instance - #region public void Add() - - /// Add the Vector passed as parameter to this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Add() method instead.")] - public void Add(Vector4 right) - { - this.X += right.X; - this.Y += right.Y; - this.Z += right.Z; - this.W += right.W; - } - - /// Add the Vector passed as parameter to this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Add() method instead.")] - public void Add(ref Vector4 right) - { - this.X += right.X; - this.Y += right.Y; - this.Z += right.Z; - this.W += right.W; - } - - #endregion public void Add() - - #region public void Sub() - - /// Subtract the Vector passed as parameter from this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Subtract() method instead.")] - public void Sub(Vector4 right) - { - this.X -= right.X; - this.Y -= right.Y; - this.Z -= right.Z; - this.W -= right.W; - } - - /// Subtract the Vector passed as parameter from this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Subtract() method instead.")] - public void Sub(ref Vector4 right) - { - this.X -= right.X; - this.Y -= right.Y; - this.Z -= right.Z; - this.W -= right.W; - } - - #endregion public void Sub() - - #region public void Mult() - - /// Multiply this instance by a scalar. - /// Scalar operand. - [Obsolete("Use static Multiply() method instead.")] - public void Mult(float f) - { - this.X *= f; - this.Y *= f; - this.Z *= f; - this.W *= f; - } - - #endregion public void Mult() - - #region public void Div() - - /// Divide this instance by a scalar. - /// Scalar operand. - [Obsolete("Use static Divide() method instead.")] - public void Div(float f) - { - float mult = 1.0f / f; - this.X *= mult; - this.Y *= mult; - this.Z *= mult; - this.W *= mult; - } - - #endregion public void Div() - #region public float Length /// @@ -388,157 +301,10 @@ namespace OpenTK #endregion - #region public void Scale() - - /// - /// Scales the current Vector4 by the given amounts. - /// - /// The scale of the X component. - /// The scale of the Y component. - /// The scale of the Z component. - /// The scale of the Z component. - [Obsolete("Use static Multiply() method instead.")] - public void Scale(float sx, float sy, float sz, float sw) - { - this.X = X * sx; - this.Y = Y * sy; - this.Z = Z * sz; - this.W = W * sw; - } - - /// Scales this instance by the given parameter. - /// The scaling of the individual components. - [CLSCompliant(false)] - [Obsolete("Use static Multiply() method instead.")] - public void Scale(Vector4 scale) - { - this.X *= scale.X; - this.Y *= scale.Y; - this.Z *= scale.Z; - this.W *= scale.W; - } - - /// Scales this instance by the given parameter. - /// The scaling of the individual components. - [CLSCompliant(false)] - [Obsolete("Use static Multiply() method instead.")] - public void Scale(ref Vector4 scale) - { - this.X *= scale.X; - this.Y *= scale.Y; - this.Z *= scale.Z; - this.W *= scale.W; - } - - #endregion public void Scale() - #endregion #region Static - #region Obsolete - - #region Sub - - /// - /// Subtract one Vector from another - /// - /// First operand - /// Second operand - /// Result of subtraction - public static Vector4 Sub(Vector4 a, Vector4 b) - { - a.X -= b.X; - a.Y -= b.Y; - a.Z -= b.Z; - a.W -= b.W; - return a; - } - - /// - /// Subtract one Vector from another - /// - /// First operand - /// Second operand - /// Result of subtraction - public static void Sub(ref Vector4 a, ref Vector4 b, out Vector4 result) - { - result.X = a.X - b.X; - result.Y = a.Y - b.Y; - result.Z = a.Z - b.Z; - result.W = a.W - b.W; - } - - #endregion - - #region Mult - - /// - /// Multiply a vector and a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the multiplication - public static Vector4 Mult(Vector4 a, float f) - { - a.X *= f; - a.Y *= f; - a.Z *= f; - a.W *= f; - return a; - } - - /// - /// Multiply a vector and a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the multiplication - public static void Mult(ref Vector4 a, float f, out Vector4 result) - { - result.X = a.X * f; - result.Y = a.Y * f; - result.Z = a.Z * f; - result.W = a.W * f; - } - - #endregion - - #region Div - - /// - /// Divide a vector by a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the division - public static Vector4 Div(Vector4 a, float f) - { - a.X /= f; - a.Y /= f; - a.Z /= f; - a.W /= f; - return a; - } - - /// - /// Divide a vector by a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the division - public static void Div(ref Vector4 a, float f, out Vector4 result) - { - result.X = a.X / f; - result.Y = a.Y / f; - result.Z = a.Z / f; - result.W = a.W / f; - } - - #endregion - - #endregion - #region Add /// diff --git a/src/OpenTK/Math/Vector4d.cs b/src/OpenTK/Math/Vector4d.cs index bed7aa1c..16816141 100644 --- a/src/OpenTK/Math/Vector4d.cs +++ b/src/OpenTK/Math/Vector4d.cs @@ -197,93 +197,6 @@ namespace OpenTK #region Instance - #region public void Add() - - /// Add the Vector passed as parameter to this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Add() method instead.")] - public void Add(Vector4d right) - { - this.X += right.X; - this.Y += right.Y; - this.Z += right.Z; - this.W += right.W; - } - - /// Add the Vector passed as parameter to this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Add() method instead.")] - public void Add(ref Vector4d right) - { - this.X += right.X; - this.Y += right.Y; - this.Z += right.Z; - this.W += right.W; - } - - #endregion public void Add() - - #region public void Sub() - - /// Subtract the Vector passed as parameter from this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Subtract() method instead.")] - public void Sub(Vector4d right) - { - this.X -= right.X; - this.Y -= right.Y; - this.Z -= right.Z; - this.W -= right.W; - } - - /// Subtract the Vector passed as parameter from this instance. - /// Right operand. This parameter is only read from. - [CLSCompliant(false)] - [Obsolete("Use static Subtract() method instead.")] - public void Sub(ref Vector4d right) - { - this.X -= right.X; - this.Y -= right.Y; - this.Z -= right.Z; - this.W -= right.W; - } - - #endregion public void Sub() - - #region public void Mult() - - /// Multiply this instance by a scalar. - /// Scalar operand. - [Obsolete("Use static Multiply() method instead.")] - public void Mult(double f) - { - this.X *= f; - this.Y *= f; - this.Z *= f; - this.W *= f; - } - - #endregion public void Mult() - - #region public void Div() - - /// Divide this instance by a scalar. - /// Scalar operand. - [Obsolete("Use static Divide() method instead.")] - public void Div(double f) - { - double mult = 1.0 / f; - this.X *= mult; - this.Y *= mult; - this.Z *= mult; - this.W *= mult; - } - - #endregion public void Div() - #region public double Length /// @@ -384,165 +297,10 @@ namespace OpenTK #endregion - #region public void Scale() - - /// - /// Scales the current Vector4d by the given amounts. - /// - /// The scale of the X component. - /// The scale of the Y component. - /// The scale of the Z component. - /// The scale of the Z component. - [Obsolete("Use static Multiply() method instead.")] - public void Scale(double sx, double sy, double sz, double sw) - { - this.X = X * sx; - this.Y = Y * sy; - this.Z = Z * sz; - this.W = W * sw; - } - - /// Scales this instance by the given parameter. - /// The scaling of the individual components. - [CLSCompliant(false)] - [Obsolete("Use static Multiply() method instead.")] - public void Scale(Vector4d scale) - { - this.X *= scale.X; - this.Y *= scale.Y; - this.Z *= scale.Z; - this.W *= scale.W; - } - - /// Scales this instance by the given parameter. - /// The scaling of the individual components. - [CLSCompliant(false)] - [Obsolete("Use static Multiply() method instead.")] - public void Scale(ref Vector4d scale) - { - this.X *= scale.X; - this.Y *= scale.Y; - this.Z *= scale.Z; - this.W *= scale.W; - } - - #endregion public void Scale() - #endregion #region Static - #region Obsolete - - #region Sub - - /// - /// Subtract one Vector from another - /// - /// First operand - /// Second operand - /// Result of subtraction - [Obsolete("Use static Subtract() method instead.")] - public static Vector4d Sub(Vector4d a, Vector4d b) - { - a.X -= b.X; - a.Y -= b.Y; - a.Z -= b.Z; - a.W -= b.W; - return a; - } - - /// - /// Subtract one Vector from another - /// - /// First operand - /// Second operand - /// Result of subtraction - [Obsolete("Use static Subtract() method instead.")] - public static void Sub(ref Vector4d a, ref Vector4d b, out Vector4d result) - { - result.X = a.X - b.X; - result.Y = a.Y - b.Y; - result.Z = a.Z - b.Z; - result.W = a.W - b.W; - } - - #endregion - - #region Mult - - /// - /// Multiply a vector and a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the multiplication - [Obsolete("Use static Multiply() method instead.")] - public static Vector4d Mult(Vector4d a, double f) - { - a.X *= f; - a.Y *= f; - a.Z *= f; - a.W *= f; - return a; - } - - /// - /// Multiply a vector and a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the multiplication - [Obsolete("Use static Multiply() method instead.")] - public static void Mult(ref Vector4d a, double f, out Vector4d result) - { - result.X = a.X * f; - result.Y = a.Y * f; - result.Z = a.Z * f; - result.W = a.W * f; - } - - #endregion - - #region Div - - /// - /// Divide a vector by a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the division - [Obsolete("Use static Divide() method instead.")] - public static Vector4d Div(Vector4d a, double f) - { - double mult = 1.0 / f; - a.X *= mult; - a.Y *= mult; - a.Z *= mult; - a.W *= mult; - return a; - } - - /// - /// Divide a vector by a scalar - /// - /// Vector operand - /// Scalar operand - /// Result of the division - [Obsolete("Use static Divide() method instead.")] - public static void Div(ref Vector4d a, double f, out Vector4d result) - { - double mult = 1.0 / f; - result.X = a.X * mult; - result.Y = a.Y * mult; - result.Z = a.Z * mult; - result.W = a.W * mult; - } - - #endregion - - #endregion - #region Add /// diff --git a/src/OpenTK/NativeWindow.cs b/src/OpenTK/NativeWindow.cs index 78590633..70b50ab0 100644 --- a/src/OpenTK/NativeWindow.cs +++ b/src/OpenTK/NativeWindow.cs @@ -6,7 +6,7 @@ // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -149,7 +149,7 @@ namespace OpenTK #region PointToClient /// - /// Transforms the specified point from screen to client coordinates. + /// Transforms the specified point from screen to client coordinates. /// /// /// A to transform. @@ -367,23 +367,6 @@ namespace OpenTK #endregion - #region InputDriver - - /// - /// This property is deprecated. - /// - [Obsolete] - public IInputDriver InputDriver - { - get - { - EnsureUndisposed(); - return implementation.InputDriver; - } - } - - #endregion - #region Location /// @@ -630,7 +613,7 @@ namespace OpenTK public event EventHandler FocusedChanged = delegate { }; /// - /// Occurs when the property of the window changes. + /// Occurs when the property of the window changes. /// public event EventHandler IconChanged = delegate { }; @@ -658,7 +641,7 @@ namespace OpenTK /// Occurs whenever the mouse cursor enters the window . /// public event EventHandler MouseEnter = delegate { }; - + /// /// Occurs whenever the mouse cursor leaves the window . /// diff --git a/src/OpenTK/OpenTK.csproj b/src/OpenTK/OpenTK.csproj index b506a6db..c0014c08 100644 --- a/src/OpenTK/OpenTK.csproj +++ b/src/OpenTK/OpenTK.csproj @@ -224,9 +224,6 @@ Code - - Code - Code @@ -440,15 +437,6 @@ Code - - Code - - - Code - - - Code - Code @@ -461,9 +449,6 @@ Code - - Code - Code @@ -494,9 +479,6 @@ Code - - Code - Code @@ -722,7 +704,6 @@ - @@ -742,7 +723,6 @@ - @@ -822,4 +802,4 @@ - + \ No newline at end of file diff --git a/src/OpenTK/Platform/Factory.cs b/src/OpenTK/Platform/Factory.cs index c56d22bd..b67ba908 100644 --- a/src/OpenTK/Platform/Factory.cs +++ b/src/OpenTK/Platform/Factory.cs @@ -6,7 +6,7 @@ // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -192,14 +192,6 @@ namespace OpenTK.Platform return defaultImplementation.CreateJoystickDriver(); } - [Obsolete] - public IJoystickDriver CreateLegacyJoystickDriver() - { - #pragma warning disable 612,618 - return defaultImplementation.CreateLegacyJoystickDriver(); - #pragma warning restore 612,618 - } - public void RegisterResource(IDisposable resource) { defaultImplementation.RegisterResource(resource); @@ -210,9 +202,9 @@ namespace OpenTK.Platform #region Fields static readonly string error_string = "Please, refer to http://www.opentk.com for more information."; - + #endregion - + #region IPlatformFactory Members public override INativeWindow CreateNativeWindow(int x, int y, int width, int height, string title, GraphicsMode mode, GameWindowFlags options, DisplayDevice device) diff --git a/src/OpenTK/Platform/INativeGLWindow.cs b/src/OpenTK/Platform/INativeGLWindow.cs deleted file mode 100644 index 83f2ea0f..00000000 --- a/src/OpenTK/Platform/INativeGLWindow.cs +++ /dev/null @@ -1,48 +0,0 @@ -#region --- License --- -/* Licensed under the MIT/X11 license. - * Copyright (c) 2006-2008 the OpenTK Team. - * This notice may not be removed from any source distribution. - * See license.txt for licensing detailed licensing details. - */ -#endregion - -using System; -using System.Collections.Generic; -#if !MINIMAL -using System.Drawing; -#endif -using System.Text; - -using OpenTK.Input; -using OpenTK.Graphics; - -namespace OpenTK.Platform -{ - [Obsolete] - internal interface INativeGLWindow : IDisposable - { - void CreateWindow(int width, int height, GraphicsMode mode, int major, int minor, GraphicsContextFlags flags, out IGraphicsContext context); - void DestroyWindow(); - void ProcessEvents(); - Point PointToClient(Point point); - Point PointToScreen(Point point); - - bool Exists { get; } - IWindowInfo WindowInfo { get; } - - string Title { get; set; } - bool Visible { get; set; } - bool IsIdle { get; } - IInputDriver InputDriver { get; } - WindowState WindowState { get; set; } - WindowBorder WindowBorder { get; set; } - - event CreateEvent Create; - event DestroyEvent Destroy; - } - - [Obsolete] - internal delegate void CreateEvent(object sender, EventArgs e); - [Obsolete] - internal delegate void DestroyEvent(object sender, EventArgs e); -} diff --git a/src/OpenTK/Platform/IPlatformFactory.cs b/src/OpenTK/Platform/IPlatformFactory.cs index b42e1ab4..655745fc 100644 --- a/src/OpenTK/Platform/IPlatformFactory.cs +++ b/src/OpenTK/Platform/IPlatformFactory.cs @@ -6,7 +6,7 @@ // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -53,9 +53,6 @@ namespace OpenTK.Platform Input.IJoystickDriver2 CreateJoystickDriver(); - [Obsolete] - Input.IJoystickDriver CreateLegacyJoystickDriver(); - void RegisterResource(IDisposable resource); } } diff --git a/src/OpenTK/Platform/LegacyInputDriver.cs b/src/OpenTK/Platform/LegacyInputDriver.cs deleted file mode 100644 index 4d5bc4b7..00000000 --- a/src/OpenTK/Platform/LegacyInputDriver.cs +++ /dev/null @@ -1,119 +0,0 @@ -#region License -// -// LegacyInputDriver.cs -// -// Author: -// Stefanos A. -// -// Copyright (c) 2006-2014 Stefanos Apostolopoulos -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -#endregion - -using System; -using System.Collections.Generic; -using OpenTK.Input; - -namespace OpenTK.Platform -{ - // IInputDriver implementation to satisfy INativeWindow - // while reducing code duplication. - [Obsolete] - class LegacyInputDriver : IInputDriver - { - List dummy_keyboard_list = new List(1); - List dummy_mice_list = new List(1); - - readonly LegacyJoystickDriver JoystickDriver = new LegacyJoystickDriver(); - - internal LegacyInputDriver(INativeWindow window) - { - if (window == null) - throw new ArgumentNullException(); - - var mouse = new MouseDevice(); - mouse.Description = "Standard Mouse"; - mouse.NumberOfButtons = 3; - mouse.NumberOfWheels = 1; - dummy_mice_list.Add(mouse); - - var keyboard = new KeyboardDevice(); - keyboard.Description = "Standard Keyboard"; - keyboard.NumberOfKeys = 101; - keyboard.NumberOfLeds = 3; - keyboard.NumberOfFunctionKeys = 12; - dummy_keyboard_list.Add(keyboard); - - // Hook mouse events - window.MouseDown += mouse.HandleMouseDown; - window.MouseUp += mouse.HandleMouseUp; - window.MouseMove += mouse.HandleMouseMove; - window.MouseWheel += mouse.HandleMouseWheel; - - // Hook keyboard events - window.KeyDown += keyboard.HandleKeyDown; - window.KeyUp += keyboard.HandleKeyUp; - } - - #region IInputDriver Members - - public void Poll() - { - } - - #endregion - - #region IKeyboardDriver Members - - public IList Keyboard - { - get { return dummy_keyboard_list; } - } - - #endregion - - #region IMouseDriver Members - - public IList Mouse - { - get { return dummy_mice_list; } - } - - #endregion - - #region IJoystickDriver Members - - public IList Joysticks - { - get { return JoystickDriver.Joysticks; } - } - - #endregion - - #region IDisposable Members - - public void Dispose() - { - } - - #endregion - } -} - diff --git a/src/OpenTK/Platform/LegacyJoystickDriver.cs b/src/OpenTK/Platform/LegacyJoystickDriver.cs deleted file mode 100644 index d85ecf81..00000000 --- a/src/OpenTK/Platform/LegacyJoystickDriver.cs +++ /dev/null @@ -1,136 +0,0 @@ -#region License -// -// LegacyJoystickDriver.cs -// -// Author: -// Stefanos A. -// -// Copyright (c) 2006-2014 Stefanos Apostolopoulos -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -#endregion - -using System; -using System.Collections.Generic; -using OpenTK.Input; - -namespace OpenTK.Platform -{ - [Obsolete] - internal class LegacyJoystickDriver : IJoystickDriver - { - static readonly string ConnectedName = "Connected Joystick"; - static readonly string DisconnectedName = "Disconnected Joystick"; - readonly List joysticks = new List(); - readonly IList joysticks_readonly; - - class LegacyJoystickDevice : JoystickDevice - { - public LegacyJoystickDevice(int id, int axes, int buttons) - : base(id, axes, buttons) - { } - } - - internal LegacyJoystickDriver() - { - joysticks_readonly = joysticks.AsReadOnly(); - for (int i = 0; i < 4; i++) - { - joysticks.Add(new LegacyJoystickDevice(i, 0, 0)); - joysticks[i].Description = DisconnectedName; - } - } - - public void Poll() - { - for (int i = 0; i < 4; i++) - { - JoystickCapabilities caps = Joystick.GetCapabilities(i); - if (caps.IsConnected && joysticks[i].Description == DisconnectedName) - { - // New joystick connected - joysticks[i] = new LegacyJoystickDevice( - i, - caps.AxisCount + 2 * caps.HatCount, - caps.ButtonCount); - //device.Description = Joystick.GetName(i); - joysticks[i].Description = ConnectedName; - - } - else if (!caps.IsConnected && joysticks[i].Description != DisconnectedName) - { - // Joystick disconnected - joysticks[i] = new LegacyJoystickDevice(i, 0, 0); - joysticks[i].Description = DisconnectedName; - } - - JoystickState state = Joystick.GetState(i); - for (int axis_index = 0; axis_index < caps.AxisCount; axis_index++) - { - JoystickAxis axis = JoystickAxis.Axis0 + axis_index; - joysticks[i].SetAxis(axis, state.GetAxis(axis)); - } - for (int button_index = 0; button_index < caps.ButtonCount; button_index++) - { - joysticks[i].SetButton(button_index, state.GetButton(button_index) == ButtonState.Pressed); - } - for (int hat_index = 0; hat_index < caps.HatCount; hat_index++) - { - // LegacyJoystickDriver report hats as pairs of axes - // Make sure we have enough axes left for this mapping - int axis_index = caps.AxisCount + 2 * hat_index; - if (axis_index < JoystickState.MaxAxes) - { - JoystickHat hat = JoystickHat.Hat0 + hat_index; - JoystickHatState hat_state = state.GetHat(hat); - JoystickAxis axis = JoystickAxis.Axis0 + axis_index; - float x = 0; - float y = 0; - if (hat_state.IsDown) - y--; - if (hat_state.IsUp) - y++; - if (hat_state.IsLeft) - x--; - if (hat_state.IsRight) - x++; - - joysticks[i].SetAxis(axis, x); - joysticks[i].SetAxis(axis + 1, y); - } - } - } - } - - #region IJoystickDriver Members - - public IList Joysticks - { - get - { - Poll(); - return joysticks_readonly; - } - } - - #endregion - } -} - diff --git a/src/OpenTK/Platform/NativeWindowBase.cs b/src/OpenTK/Platform/NativeWindowBase.cs index 16579e53..93c7a494 100644 --- a/src/OpenTK/Platform/NativeWindowBase.cs +++ b/src/OpenTK/Platform/NativeWindowBase.cs @@ -40,10 +40,6 @@ 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(); readonly MouseMoveEventArgs MouseMoveArgs = new MouseMoveEventArgs(); @@ -62,9 +58,6 @@ 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); @@ -448,15 +441,6 @@ namespace OpenTK.Platform public abstract Size ClientSize { get; set; } - [Obsolete] - public virtual IInputDriver InputDriver - { - get - { - return LegacyInputDriver; - } - } - public abstract bool CursorVisible { get; set; } public abstract MouseCursor Cursor { get; set; } diff --git a/src/OpenTK/Platform/PlatformFactoryBase.cs b/src/OpenTK/Platform/PlatformFactoryBase.cs index 69341d7a..203660ab 100644 --- a/src/OpenTK/Platform/PlatformFactoryBase.cs +++ b/src/OpenTK/Platform/PlatformFactoryBase.cs @@ -78,12 +78,6 @@ namespace OpenTK.Platform public abstract IJoystickDriver2 CreateJoystickDriver(); - [Obsolete] - public virtual IJoystickDriver CreateLegacyJoystickDriver() - { - return new LegacyJoystickDriver(); - } - public void RegisterResource(IDisposable resource) { lock (sync) diff --git a/src/OpenTK/Platform/Utilities.cs b/src/OpenTK/Platform/Utilities.cs index 6720066c..7d4e016f 100644 --- a/src/OpenTK/Platform/Utilities.cs +++ b/src/OpenTK/Platform/Utilities.cs @@ -222,28 +222,6 @@ namespace OpenTK.Platform #region --- Creating a Graphics Context --- - /// - /// Creates an IGraphicsContext instance for the specified window. - /// - /// The GraphicsMode for the GraphicsContext. - /// An IWindowInfo instance describing the parent window for this IGraphicsContext. - /// The major OpenGL version number for this IGraphicsContext. - /// The minor OpenGL version number for this IGraphicsContext. - /// A bitwise collection of GraphicsContextFlags with specific options for this IGraphicsContext. - /// A new IGraphicsContext instance. - [Obsolete("Call new OpenTK.Graphics.GraphicsContext() directly, instead.")] - public static IGraphicsContext CreateGraphicsContext( - GraphicsMode mode, IWindowInfo window, - int major, int minor, GraphicsContextFlags flags) - { - GraphicsContext context = new GraphicsContext(mode, window, major, minor, flags); - context.MakeCurrent(window); - - (context as IGraphicsContextInternal).LoadAll(); - - return context; - } - #region CreateX11WindowInfo /// @@ -318,7 +296,7 @@ namespace OpenTK.Platform /// The X offset for the GL viewport /// The Y offset for the GL viewport /// A new IWindowInfo instance. - public static IWindowInfo CreateMacOSCarbonWindowInfo(IntPtr windowHandle, bool ownHandle, bool isControl, + public static IWindowInfo CreateMacOSCarbonWindowInfo(IntPtr windowHandle, bool ownHandle, bool isControl, OpenTK.Platform.MacOS.GetInt xOffset, OpenTK.Platform.MacOS.GetInt yOffset) { return new OpenTK.Platform.MacOS.CarbonWindowInfo(windowHandle, false, isControl, xOffset, yOffset); @@ -397,8 +375,8 @@ namespace OpenTK.Platform #if !__MOBILE__ /// - /// Creates an IWindowInfo instance for Angle rendering, based on - /// supplied platform window (e.g. a window created with + /// Creates an IWindowInfo instance for Angle rendering, based on + /// supplied platform window (e.g. a window created with /// CreateWindowsWindowInfo, or CreateDummyWindowInfo). /// /// diff --git a/src/OpenTK/Platform/X11/API.cs b/src/OpenTK/Platform/X11/API.cs index 952a80e3..8d6a6277 100644 --- a/src/OpenTK/Platform/X11/API.cs +++ b/src/OpenTK/Platform/X11/API.cs @@ -632,75 +632,6 @@ XF86VidModeGetGammaRampSize( #endregion - #region internal class SetWindowAttributes - - [StructLayout(LayoutKind.Sequential), Obsolete("Use XSetWindowAttributes instead")] - internal class SetWindowAttributes - { - /// - /// background, None, or ParentRelative - /// - public Pixmap background_pixmap; - /// - /// background pixel - /// - public long background_pixel; - /// - /// border of the window or CopyFromParent - /// - public Pixmap border_pixmap; - /// - /// border pixel value - /// - public long border_pixel; - /// - /// one of bit gravity values - /// - public int bit_gravity; - /// - /// one of the window gravity values - /// - public int win_gravity; - /// - /// NotUseful, WhenMapped, Always - /// - public int backing_store; - /// - /// planes to be preserved if possible - /// - public long backing_planes; - /// - /// value to use in restoring planes - /// - public long backing_pixel; - /// - /// should bits under be saved? (popups) - /// - public bool save_under; - /// - /// set of events that should be saved - /// - public EventMask event_mask; - /// - /// set of events that should not propagate - /// - public long do_not_propagate_mask; - /// - /// boolean value for override_redirect - /// - public bool override_redirect; - /// - /// color map to be associated with window - /// - public Colormap colormap; - /// - /// cursor to be displayed (or None) - /// - public Cursor cursor; - } - - #endregion - #region internal struct SizeHints [StructLayout(LayoutKind.Sequential)]