Merge pull request #549 from Nihlus/remove-obsolete-code

Remove code marked obsolete
This commit is contained in:
varon 2017-07-04 21:37:15 +02:00 committed by GitHub
commit 7bf31b18e1
39 changed files with 166 additions and 3414 deletions

View file

@ -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<T> (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) {

View file

@ -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
*/

View file

@ -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()
/// <summary>
/// Grabs a screenshot of the frontbuffer contents.
/// When using multiple <c>GLControl</c>s, ensure that <see cref="Context"/>
/// is current before accessing this property.
/// <seealso cref="Context"/>
/// <seealso cref="MakeCurrent"/>
/// </summary>
/// <returns>A System.Drawing.Bitmap, containing the contents of the frontbuffer.</returns>
/// <exception cref="OpenTK.Graphics.GraphicsContextException">
/// Occurs when no OpenTK.Graphics.GraphicsContext is current in the calling thread.
/// </exception>
[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

View file

@ -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
/// <summary>
/// A reflection handle to the nested type that contains the function delegates.
/// </summary>
[Obsolete("Not used")]
readonly protected Type DelegatesClass;
/// <summary>
/// A refection handle to the nested type that contains core functions (i.e. not extensions).
/// </summary>
[Obsolete("Not used")]
readonly protected Type CoreClass;
/// <summary>
/// A mapping of core function names to MethodInfo handles.
/// </summary>
[Obsolete("Not used")]
readonly protected SortedList<string, MethodInfo> 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.
/// </summary>
/// <remarks>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.</remarks>
protected abstract object SyncRoot { get; }

View file

@ -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<DisplayResolution> available_resolutions = new List<DisplayResolution>();
IList<DisplayResolution> 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<DisplayDevice> AvailableDisplays
/// <summary>
/// Gets the list of available <see cref="DisplayDevice"/> objects.
/// This function allocates memory.
/// </summary>
[Obsolete("Use GetDisplay(DisplayIndex) instead.")]
public static IList<DisplayDevice> AvailableDisplays
{
get
{
List<DisplayDevice> displays = new List<DisplayDevice>();
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
/// <summary>Gets the default (primary) display of this system.</summary>

View file

@ -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
/// <summary>
/// Gets a readonly IList containing all available OpenTK.Input.JoystickDevices.
/// </summary>
[Obsolete("Use OpenTK.Input.Joystick and GamePad instead")]
public IList<JoystickDevice> Joysticks
{
get { return LegacyJoystick.Joysticks; }
}
#endregion
#region Keyboard
#pragma warning disable 0612
/// <summary>
/// Gets the primary Keyboard device, or null if no Keyboard exists.
/// </summary>
public KeyboardDevice Keyboard
{
get { return InputDriver.Keyboard.Count > 0 ? InputDriver.Keyboard[0] : null; }
}
#pragma warning restore 0612
#endregion
#region Mouse
#pragma warning disable 0612
/// <summary>
/// Gets the primary Mouse device, or null if no Mouse exists.
/// </summary>
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.

View file

@ -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.
/// </summary>
public float R;
/// <summary>
/// The green component of this Color4 structure.
/// </summary>
public float G;
/// <summary>
/// The blue component of this Color4 structure.
/// </summary>
public float B;
/// <summary>
/// The alpha component of this Color4 structure.
/// </summary>
@ -97,15 +97,6 @@ namespace OpenTK.Graphics
A = a / (float)Byte.MaxValue;
}
/// <summary>
/// Constructs a new Color4 structure from the specified System.Drawing.Color.
/// </summary>
/// <param name="color">The System.Drawing.Color containing the component values.</param>
[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

View file

@ -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
/// </summary>
public abstract class GraphicsBindingsBase : BindingsBase
{
/// <summary>
/// Contains the list of API entry points (function pointers).
/// This field must be set by an inheriting class.
/// </summary>
[Obsolete("Not used - this field remains for 1.1 API compatibility")]
protected IntPtr[] EntryPointsInstance;
/// <summary>
/// with the 1.1 API.
/// Contains the list of API entry point names.
/// This field must be set by an inheriting class.
/// </summary>
[Obsolete("Not used - this field remains for 1.1 API compatibility")]
protected string[] EntryPointNamesInstance;
internal IntPtr[] _EntryPointsInstance;
internal byte[] _EntryPointNamesInstance;
internal int[] _EntryPointNameOffsetsInstance;

View file

@ -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
{
/// <summary>
/// Used to retrive function pointers by name.
/// Used to retrive function pointers by name.
/// </summary>
/// <param name="function">The function name.</param>
/// <returns>A function pointer to <paramref name="function"/>, or <c>IntPtr.Zero</c></returns>
@ -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<ContextHandle, IGraphicsContext> available_contexts =
new Dictionary<ContextHandle, IGraphicsContext>();
@ -102,7 +102,8 @@ namespace OpenTK.Graphics
}
/// <summary>
/// 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.
/// </summary>
/// <param name="mode">The OpenTK.Graphics.GraphicsMode of the GraphicsContext.</param>
/// <param name="window">The OpenTK.Platform.IWindowInfo to attach the GraphicsContext to.</param>
@ -252,7 +253,8 @@ namespace OpenTK.Graphics
}
/// <summary>
/// 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.
/// </summary>
/// <param name="handle">The handle of the existing context. This must be a valid, unique handle that is not known to OpenTK.</param>
/// <param name="window">This parameter is reserved.</param>
@ -360,45 +362,6 @@ namespace OpenTK.Graphics
#region --- Static Members ---
#region public static GraphicsContext CreateDummyContext()
/// <summary>
/// Creates a dummy GraphicsContext to allow OpenTK to work with contexts created by external libraries.
/// </summary>
/// <returns>A new, dummy GraphicsContext instance.</returns>
/// <remarks>
/// <para>Instances created by this method will not be functional. Instance methods will have no effect.</para>
/// <para>This method requires that a context is current on the calling thread.</para>
/// </remarks>
[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);
}
/// <summary>
/// Creates a dummy GraphicsContext to allow OpenTK to work with contexts created by external libraries.
/// </summary>
/// <param name="handle">The handle of a context.</param>
/// <returns>A new, dummy GraphicsContext instance.</returns>
/// <remarks>
/// <para>Instances created by this method will not be functional. Instance methods will have no effect.</para>
/// </remarks>
[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()
/// <summary>
@ -538,31 +501,11 @@ namespace OpenTK.Graphics
private set { disposed = value; }
}
/// <summary>
/// [obsolete] Use SwapInterval property instead.
/// Gets or sets a value indicating whether VSync is enabled. When VSync is
/// enabled, <see cref="SwapBuffers()"/> calls will be synced to the refresh
/// rate of the <see cref="DisplayDevice"/> 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 <see cref="SwapInterval"/>
/// value.
/// </summary>
[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
}
/// <summary>
/// Gets or sets a positive integer in the range [1, n), indicating the number of
/// <see cref="DisplayDevice"/> refreshes between consecutive
/// <see cref="SwapBuffers()"/> calls. The maximum value for n is
/// implementation-dependent. The default value is 1.
/// This value will only affect instances where <see cref="VSync"/> is enabled.
/// Invalid values will be clamped to the valid range.
/// </summary>
public int SwapInterval
@ -594,7 +537,7 @@ namespace OpenTK.Graphics
implementation.LoadAll();
}
#endregion
#region --- IGraphicsContextInternal Members ---

View file

@ -41,24 +41,11 @@ namespace OpenTK.Graphics
/// </summary>
bool IsDisposed { get; }
/// <summary>
/// Gets or sets a value indicating whether VSync is enabled. When VSync is
/// enabled, <see cref="SwapBuffers()"/> calls will be synced to the refresh
/// rate of the <see cref="DisplayDevice"/> 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 <see cref="SwapInterval"/>
/// value.
/// </summary>
[Obsolete("Use SwapInterval property instead.")]
bool VSync { get; set; }
/// <summary>
/// Gets or sets a positive integer in the range [1, n), indicating the number of
/// <see cref="DisplayDevice"/> refreshes between consecutive
/// <see cref="SwapBuffers()"/> calls. The maximum value for n is
/// implementation-dependent. The default value is 1.
/// This value will only affect instances where <see cref="VSync"/> is enabled.
/// Invalid values will be clamped to the valid range.
/// </summary>
int SwapInterval { get; set; }

View file

@ -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 ---
/// <summary>
/// Loads all OpenGL entry points (core and extension).
/// This method is provided for compatibility purposes with older OpenTK versions.
/// </summary>
[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 ---
/// <summary>
@ -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
{
/// <summary>[requires: EXT_direct_state_access]</summary>
[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);
}
/// <summary>[requires: EXT_direct_state_access]</summary>
[Obsolete("Use ClearNamedBufferSubData(..., format, type, data) instead.")]
[CLSCompliant(false)]
public static void ClearNamedBufferSubData<T6>(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);
}
/// <summary>[requires: EXT_direct_state_access]</summary>
[Obsolete("Use ClearNamedBufferSubData(..., format, type, data) instead.")]
[CLSCompliant(false)]
public static void ClearNamedBufferSubData<T6>(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);
}
/// <summary>[requires: EXT_direct_state_access]</summary>
[Obsolete("Use ClearNamedBufferSubData(..., format, type, data) instead.")]
[CLSCompliant(false)]
public static void ClearNamedBufferSubData<T6>(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);
}
/// <summary>[requires: EXT_direct_state_access]</summary>
[Obsolete("Use ClearNamedBufferSubData(..., format, type, data) instead.")]
[CLSCompliant(false)]
public static void ClearNamedBufferSubData<T6>(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);
}
/// <summary>[requires: EXT_direct_state_access]</summary>
[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);
}
/// <summary>[requires: EXT_direct_state_access]</summary>
[Obsolete("Use ClearNamedBufferSubData(..., format, type, data) instead.")]
[CLSCompliant(false)]
public static void ClearNamedBufferSubData<T6>(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);
}
/// <summary>[requires: EXT_direct_state_access]</summary>
[Obsolete("Use ClearNamedBufferSubData(..., format, type, data) instead.")]
[CLSCompliant(false)]
public static void ClearNamedBufferSubData<T6>(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);
}
/// <summary>[requires: EXT_direct_state_access]</summary>
[Obsolete("Use ClearNamedBufferSubData(..., format, type, data) instead.")]
[CLSCompliant(false)]
public static void ClearNamedBufferSubData<T6>(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);
}
/// <summary>[requires: EXT_direct_state_access]</summary>
[Obsolete("Use ClearNamedBufferSubData(..., format, type, data) instead.")]
[CLSCompliant(false)]
public static void ClearNamedBufferSubData<T6>(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
/// <summary>
/// Defines the signature of a debug callback for
/// Defines the signature of a debug callback for
/// <see cref="GL.Amd.DebugMessageCallback"/>.
/// </summary>
/// <param name="id">The id of this debug message.</param>
@ -1618,7 +1382,7 @@ namespace OpenTK.Graphics.OpenGL
int length, IntPtr message, IntPtr userParam);
/// <summary>
/// Defines the signature of a debug callback for
/// Defines the signature of a debug callback for
/// <see cref="GL.Arb.DebugMessageCallback"/>.
/// </summary>
/// <param name="source">The <see cref="DebugSource"/> for this debug message.</param>
@ -1635,7 +1399,7 @@ namespace OpenTK.Graphics.OpenGL
IntPtr userParam);
/// <summary>
/// Defines the signature of a debug callback for
/// Defines the signature of a debug callback for
/// <see cref="GL.DebugMessageCallback"/>.
/// </summary>
/// <param name="source">The <see cref="DebugSource"/> for this debug message.</param>
@ -1652,7 +1416,7 @@ namespace OpenTK.Graphics.OpenGL
IntPtr userParam);
/// <summary>
/// Defines the signature of a debug callback for
/// Defines the signature of a debug callback for
/// <see cref="GL.Khr.DebugMessageCallback"/>.
/// </summary>
/// <param name="source">The <see cref="DebugSource"/> for this debug message.</param>

View file

@ -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
{
/// <summary>
/// Defines the interface for a native window.
/// Defines the interface for a native window.
/// </summary>
public interface INativeWindow : IDisposable
{
@ -50,32 +50,32 @@ namespace OpenTK
/// Gets or sets the title of the window.
/// </summary>
string Title { get; set; }
/// <summary>
/// Gets a System.Boolean that indicates whether this window has input focus.
/// </summary>
bool Focused { get; }
/// <summary>
/// Gets or sets a System.Boolean that indicates whether the window is visible.
/// </summary>
bool Visible { get; set; }
/// <summary>
/// Gets a System.Boolean that indicates whether the window has been created and has not been destroyed.
/// </summary>
bool Exists { get; }
/// <summary>
/// Gets the <see cref="OpenTK.Platform.IWindowInfo"/> for this window.
/// </summary>
IWindowInfo WindowInfo { get; }
/// <summary>
/// Gets or sets the <see cref="OpenTK.WindowState"/> for this window.
/// </summary>
WindowState WindowState { get; set; }
/// <summary>
/// Gets or sets the <see cref="OpenTK.WindowBorder"/> for this window.
/// </summary>
@ -86,54 +86,48 @@ namespace OpenTK
/// External bounds include the title bar, borders and drawing area of the window.
/// </summary>
Rectangle Bounds { get; set; }
/// <summary>
/// Gets or sets a <see cref="System.Drawing.Point"/> structure that contains the location of this window on the desktop.
/// </summary>
Point Location { get; set; }
/// <summary>
/// Gets or sets a <see cref="System.Drawing.Size"/> structure that contains the external size of this window.
/// </summary>
Size Size { get; set; }
/// <summary>
/// Gets or sets the horizontal location of this window on the desktop.
/// </summary>
int X { get; set; }
/// <summary>
/// Gets or sets the vertical location of this window on the desktop.
/// </summary>
int Y { get; set; }
/// <summary>
/// Gets or sets the external width of this window.
/// </summary>
int Width { get; set; }
/// <summary>
/// Gets or sets the external height of this window.
/// </summary>
int Height { get; set; }
/// <summary>
/// Gets or sets a <see cref="System.Drawing.Rectangle"/> 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.
/// </summary>
Rectangle ClientRectangle { get; set; }
/// <summary>
/// Gets or sets a <see cref="System.Drawing.Size"/> structure that contains the internal size this window.
/// </summary>
Size ClientSize { get; set; }
/// <summary>
/// This property is deprecated and should not be used.
/// </summary>
[Obsolete("Use OpenTK.Input.Mouse/Keyboard/Joystick/GamePad instead.")]
OpenTK.Input.IInputDriver InputDriver { get; }
/// <summary>
/// Gets or sets the <see cref="OpenTK.MouseCursor"/> for this window.
/// </summary>
@ -154,14 +148,14 @@ namespace OpenTK
/// Closes this window.
/// </summary>
void Close();
/// <summary>
/// Processes pending window events.
/// </summary>
void ProcessEvents();
/// <summary>
/// Transforms the specified point from screen to client coordinates.
/// Transforms the specified point from screen to client coordinates.
/// </summary>
/// <param name="point">
/// A <see cref="System.Drawing.Point"/> to transform.
@ -170,9 +164,9 @@ namespace OpenTK
/// The point transformed to client coordinates.
/// </returns>
Point PointToClient(Point point);
/// <summary>
/// Transforms the specified point from client to screen coordinates.
/// Transforms the specified point from client to screen coordinates.
/// </summary>
/// <param name="point">
/// A <see cref="System.Drawing.Point"/> to transform.
@ -183,32 +177,32 @@ namespace OpenTK
Point PointToScreen(Point point);
/// <summary>
/// Occurs whenever the window is moved.
/// Occurs whenever the window is moved.
/// </summary>
event EventHandler<EventArgs> Move;
/// <summary>
/// Occurs whenever the window is resized.
/// Occurs whenever the window is resized.
/// </summary>
event EventHandler<EventArgs> Resize;
/// <summary>
/// Occurs when the window is about to close.
/// Occurs when the window is about to close.
/// </summary>
event EventHandler<CancelEventArgs> Closing;
/// <summary>
/// Occurs after the window has closed.
/// Occurs after the window has closed.
/// </summary>
event EventHandler<EventArgs> Closed;
/// <summary>
/// Occurs when the window is disposed.
/// Occurs when the window is disposed.
/// </summary>
event EventHandler<EventArgs> Disposed;
/// <summary>
/// Occurs when the <see cref="Icon"/> property of the window changes.
/// Occurs when the <see cref="Icon"/> property of the window changes.
/// </summary>
event EventHandler<EventArgs> IconChanged;
@ -246,7 +240,7 @@ namespace OpenTK
/// Occurs whenever a character is typed.
/// </summary>
event EventHandler<KeyPressEventArgs> KeyPress;
/// <summary>
/// Occurs whenever a keyboard key is released.
/// </summary>

View file

@ -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
{
/// <summary>
/// Defines the interface for an input driver.
/// </summary>
[Obsolete("This interface has been replaced by OpenTK.Input.Keyboard, Mouse, Joystick and GamePad.")]
public interface IInputDriver : IKeyboardDriver, IMouseDriver, IJoystickDriver, IDisposable
{
/// <summary>
/// Updates the state of the driver.
/// </summary>
void Poll();
}
}

View file

@ -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
{
/// <summary>
/// Defines the interface for JoystickDevice drivers.
/// </summary>
[Obsolete]
public interface IJoystickDriver
{
/// <summary>
/// Gets the list of available JoystickDevices.
/// </summary>
IList<JoystickDevice> Joysticks { get; }
}
}

View file

@ -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
{
/// <summary>
/// Defines the interface for KeyboardDevice drivers.
/// </summary>
[Obsolete]
public interface IKeyboardDriver
{
/// <summary>
/// Gets the list of available KeyboardDevices.
/// </summary>
IList<KeyboardDevice> Keyboard { get; }
}
}

View file

@ -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
{
/// <summary>
/// Defines the interface for MouseDevice drivers.
/// </summary>
[Obsolete]
public interface IMouseDriver
{
/// <summary>
/// Gets the list of available MouseDevices.
/// </summary>
IList<MouseDevice> Mouse { get; }
}
}

View file

@ -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
/// <summary>
/// Gets a value indicating the InputDeviceType of this InputDevice.
/// Gets a value indicating the InputDeviceType of this InputDevice.
/// </summary>
public InputDeviceType DeviceType
{
@ -303,67 +303,5 @@ namespace OpenTK.Input
#endregion
#endregion
#region COMPAT_REV1519
#if COMPAT_REV1519
#region public int WheelDelta
/// <summary>
/// Gets an integer representing the relative wheel movement.
/// </summary>
[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
/// <summary>
/// Gets an integer representing the relative x movement of the pointer, in pixel coordinates.
/// </summary>
[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
/// <summary>
/// Gets an integer representing the relative y movement of the pointer, in pixel coordinates.
/// </summary>
[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
}
}

View file

@ -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
{
/// <summary>
/// Contains mathematical functions for the OpenTK.Math toolkit.
/// </summary>
[Obsolete("Use OpenTK.MathHelper instead.")]
public static class Functions
{
#region NextPowerOfTwo
/// <summary>
/// Returns the next power of two that is larger than the specified number.
/// </summary>
/// <param name="n">The specified number.</param>
/// <returns>The next power of two.</returns>
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)));
}
/// <summary>
/// Returns the next power of two that is larger than the specified number.
/// </summary>
/// <param name="n">The specified number.</param>
/// <returns>The next power of two.</returns>
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)));
}
/// <summary>
/// Returns the next power of two that is larger than the specified number.
/// </summary>
/// <param name="n">The specified number.</param>
/// <returns>The next power of two.</returns>
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)));
}
/// <summary>
/// Returns the next power of two that is larger than the specified number.
/// </summary>
/// <param name="n">The specified number.</param>
/// <returns>The next power of two.</returns>
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
/// <summary>Calculates the factorial of a given natural number.
/// </summary>
/// <param name="n">The number.</param>
/// <returns>n!</returns>
public static long Factorial(int n)
{
long result = 1;
for (; n > 1; n--)
result *= n;
return result;
}
#endregion
#region BinomialCoefficient
/// <summary>
/// Calculates the binomial coefficient <paramref name="n"/> above <paramref name="k"/>.
/// </summary>
/// <param name="n">The n.</param>
/// <param name="k">The k.</param>
/// <returns>n! / (k! * (n - k)!)</returns>
public static long BinomialCoefficient(int n, int k)
{
return Factorial(n) / (Factorial(k) * Factorial(n - k));
}
#endregion
#region InverseSqrtFast
/// <summary>
/// Returns an approximation of the inverse square root of left number.
/// </summary>
/// <param name="x">A number.</param>
/// <returns>An approximation of the inverse square root of the specified number, with an upper error bound of 0.001</returns>
/// <remarks>
/// 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/
/// </remarks>
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;
}
}
/// <summary>
/// Returns an approximation of the inverse square root of left number.
/// </summary>
/// <param name="x">A number.</param>
/// <returns>An approximation of the inverse square root of the specified number, with an upper error bound of 0.001</returns>
/// <remarks>
/// 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/
/// </remarks>
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
/// <summary>
/// Convert degrees to radians
/// </summary>
/// <param name="degrees">An angle in degrees</param>
/// <returns>The angle expressed in radians</returns>
public static float DegreesToRadians(float degrees)
{
const float degToRad = (float)System.Math.PI / 180.0f;
return degrees * degToRad;
}
/// <summary>
/// Convert radians to degrees
/// </summary>
/// <param name="radians">An angle in radians</param>
/// <returns>The angle expressed in degrees</returns>
public static float RadiansToDegrees(float radians)
{
const float radToDeg = 180.0f / (float)System.Math.PI;
return radians * radToDeg;
}
#endregion
#region Mathematical constants
/// <summary>
/// Obsolete. Do not use.
/// </summary>
public static readonly float PIF = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930382f;
/// <summary>
/// Obsolete. Do not use.
/// </summary>
public static readonly float RTODF = 180.0f / PIF;
/// <summary>
/// Obsolete. Do not use.
/// </summary>
public static readonly float DTORF = PIF / 180.0f;
/// <summary>
/// Obsolete. Do not use.
/// </summary>
public static readonly double PI = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930382d;
/// <summary>
/// Obsolete. Do not use.
/// </summary>
public static readonly double RTOD = 180.0d / PIF;
/// <summary>
/// Obsolete. Do not use.
/// </summary>
public static readonly double DTOR = PIF / 180.0d;
#endregion
#region Swap
/// <summary>
/// Swaps two float values.
/// </summary>
/// <param name="a">The first value.</param>
/// <param name="b">The second value.</param>
public static void Swap(ref double a, ref double b)
{
double temp = a;
a = b;
b = temp;
}
/// <summary>
/// Swaps two float values.
/// </summary>
/// <param name="a">The first value.</param>
/// <param name="b">The second value.</param>
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 ---
/// <summary>
/// Adds the given Vector2 to the current Vector3.
/// </summary>
/// <param name="right">The right operand of the addition.</param>
/// <returns>A new Vector3 containing the result of the addition.</returns>
public static Vector2 Add(Vector2 left, Vector2 right)
{
return new Vector2(left).Add(right);
}
/// <summary>
/// Adds the given Vector3 to the current Vector3.
/// </summary>
/// <param name="right">The right operand of the addition.</param>
/// <returns>A new Vector3 containing the result of the addition.</returns>
public static Vector3 Add(Vector2 left, Vector3 right)
{
return new Vector3(left).Add(right);
}
/// <summary>
/// Adds the given Vector4 to the current Vector3. W-coordinate remains unaffected.
/// </summary>
/// <param name="right">The right operand of the addition.</param>
/// <returns>A new Vector4 containing the result of the addition.</returns>
public static Vector4 Add(Vector2 left, Vector4 right)
{
return new Vector4(left).Add(right);
}
/// <summary>
/// Adds the given Vector2 to the current Vector3.
/// </summary>
/// <param name="right">The right operand of the addition.</param>
/// <returns>A new Vector3 containing the result of the addition.</returns>
public static Vector3 Add(Vector3 left, Vector2 right)
{
return new Vector3(left).Add(right);
}
/// <summary>
/// Adds the given Vector3 to the current Vector3.
/// </summary>
/// <param name="right">The right operand of the addition.</param>
/// <returns>A new Vector3 containing the result of the addition.</returns>
public static Vector3 Add(Vector3 left, Vector3 right)
{
return new Vector3(left).Add(right);
}
/// <summary>
/// Adds the given Vector4 to the current Vector3. W-coordinate remains unaffected.
/// </summary>
/// <param name="right">The right operand of the addition.</param>
/// <returns>A new Vector4 containing the result of the addition.</returns>
public static Vector4 Add(Vector3 left, Vector4 right)
{
return new Vector4(left).Add(right);
}
/// <summary>
/// Adds the given Vector2 to the current Vector3.
/// </summary>
/// <param name="right">The right operand of the addition.</param>
/// <returns>A new Vector3 containing the result of the addition.</returns>
public static Vector4 Add(Vector4 left, Vector2 right)
{
return new Vector4(left).Add(right);
}
/// <summary>
/// Adds the given Vector3 to the current Vector3.
/// </summary>
/// <param name="right">The right operand of the addition.</param>
/// <returns>A new Vector3 containing the result of the addition.</returns>
public static Vector4 Add(Vector4 left, Vector3 right)
{
return new Vector4(left).Add(right);
}
/// <summary>
/// Adds the given Vector4 to the current Vector3. W-coordinate remains unaffected.
/// </summary>
/// <param name="right">The right operand of the addition.</param>
/// <returns>A new Vector4 containing the result of the addition.</returns>
public static Vector4 Add(Vector4 left, Vector4 right)
{
return new Vector4(left).Add(right);
}
#endregion
#region --- Subtraction ---
#endregion
#region --- Cross ---
/// <summary>
/// Computes the cross product between the current and the given Vector3. The current Vector3 is set to the result of the computation.
/// </summary>
/// <param name="right">The right operand of the cross product</param>
/// <returns>The current </returns>
public static Vector3 Cross(Vector3 left, Vector3 right)
{
return new Vector3(left).Cross(right);
}
#endregion
#endregion
}
#endif
}

View file

@ -56,7 +56,7 @@ namespace OpenTK
/// Bottom row of the matrix.
/// </summary>
public Vector4 Row3;
/// <summary>
/// The identity matrix.
/// </summary>
@ -284,7 +284,7 @@ namespace OpenTK
/// Gets or sets the value at row 4, column 4 of this instance.
/// </summary>
public float M44 { get { return Row3.W; } set { Row3.W = value; } }
/// <summary>
/// Gets or sets the values along the main diagonal of the matrix.
/// </summary>
@ -525,9 +525,9 @@ namespace OpenTK
#endregion
#region Static
#region CreateFromAxisAngle
/// <summary>
/// Build a rotation matrix from the specified axis/angle rotation.
/// </summary>
@ -571,7 +571,7 @@ namespace OpenTK
result.Row2.W = 0;
result.Row3 = Vector4.UnitW;
}
/// <summary>
/// Build a rotation matrix from the specified axis/angle rotation.
/// </summary>
@ -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
/// <summary>
/// Creates a perspective projection matrix.
/// </summary>
@ -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);
}
/// <summary>
/// Creates a perspective projection matrix.
/// </summary>
@ -991,11 +991,11 @@ namespace OpenTK
CreatePerspectiveFieldOfView(fovy, aspect, zNear, zFar, out result);
return result;
}
#endregion
#region CreatePerspectiveOffCenter
/// <summary>
/// Creates an perspective projection matrix.
/// </summary>
@ -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;
}
/// <summary>
/// Creates an perspective projection matrix.
/// </summary>
@ -1075,187 +1075,6 @@ namespace OpenTK
#endregion
#region Obsolete Functions
#region Translation Functions
/// <summary>
/// Builds a translation matrix.
/// </summary>
/// <param name="trans">The translation vector.</param>
/// <returns>A new Matrix4 instance.</returns>
[Obsolete("Use CreateTranslation instead.")]
public static Matrix4 Translation(Vector3 trans)
{
return CreateTranslation(trans);
}
/// <summary>
/// Build a translation matrix with the given translation
/// </summary>
/// <param name="x">X translation</param>
/// <param name="y">Y translation</param>
/// <param name="z">Z translation</param>
/// <returns>A Translation matrix</returns>
[Obsolete("Use CreateTranslation instead.")]
public static Matrix4 Translation(float x, float y, float z)
{
return CreateTranslation(x, y, z);
}
#endregion
#region Rotation Functions
/// <summary>
/// Build a rotation matrix that rotates about the x-axis
/// </summary>
/// <param name="angle">angle in radians to rotate counter-clockwise around the x-axis</param>
/// <returns>A rotation matrix</returns>
[Obsolete("Use CreateRotationX instead.")]
public static Matrix4 RotateX(float angle)
{
return CreateRotationX(angle);
}
/// <summary>
/// Build a rotation matrix that rotates about the y-axis
/// </summary>
/// <param name="angle">angle in radians to rotate counter-clockwise around the y-axis</param>
/// <returns>A rotation matrix</returns>
[Obsolete("Use CreateRotationY instead.")]
public static Matrix4 RotateY(float angle)
{
return CreateRotationY(angle);
}
/// <summary>
/// Build a rotation matrix that rotates about the z-axis
/// </summary>
/// <param name="angle">angle in radians to rotate counter-clockwise around the z-axis</param>
/// <returns>A rotation matrix</returns>
[Obsolete("Use CreateRotationZ instead.")]
public static Matrix4 RotateZ(float angle)
{
return CreateRotationZ(angle);
}
/// <summary>
/// Build a rotation matrix to rotate about the given axis
/// </summary>
/// <param name="axis">the axis to rotate about</param>
/// <param name="angle">angle in radians to rotate counter-clockwise (looking in the direction of the given axis)</param>
/// <returns>A rotation matrix</returns>
[Obsolete("Use CreateFromAxisAngle instead.")]
public static Matrix4 Rotate(Vector3 axis, float angle)
{
return CreateFromAxisAngle(axis, angle);
}
/// <summary>
/// Build a rotation matrix from a quaternion
/// </summary>
/// <param name="q">the quaternion</param>
/// <returns>A rotation matrix</returns>
[Obsolete("Use CreateFromQuaternion instead.")]
public static Matrix4 Rotate(Quaternion q)
{
return CreateFromQuaternion(q);
}
#endregion
#region Scale Functions
/// <summary>
/// Build a scaling matrix
/// </summary>
/// <param name="scale">Single scale factor for x,y and z axes</param>
/// <returns>A scaling matrix</returns>
[Obsolete("Use CreateScale instead.")]
public static Matrix4 Scale(float scale)
{
return Scale(scale, scale, scale);
}
/// <summary>
/// Build a scaling matrix
/// </summary>
/// <param name="scale">Scale factors for x,y and z axes</param>
/// <returns>A scaling matrix</returns>
[Obsolete("Use CreateScale instead.")]
public static Matrix4 Scale(Vector3 scale)
{
return Scale(scale.X, scale.Y, scale.Z);
}
/// <summary>
/// Build a scaling matrix
/// </summary>
/// <param name="x">Scale factor for x-axis</param>
/// <param name="y">Scale factor for y-axis</param>
/// <param name="z">Scale factor for z-axis</param>
/// <returns>A scaling matrix</returns>
[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
/// <summary>
/// Build a projection matrix
/// </summary>
/// <param name="left">Left edge of the view frustum</param>
/// <param name="right">Right edge of the view frustum</param>
/// <param name="bottom">Bottom edge of the view frustum</param>
/// <param name="top">Top edge of the view frustum</param>
/// <param name="near">Distance to the near clip plane</param>
/// <param name="far">Distance to the far clip plane</param>
/// <returns>A projection matrix that transforms camera space to raster space</returns>
[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));
}
/// <summary>
/// Build a projection matrix
/// </summary>
/// <param name="fovy">Angle of the field of view in the y direction (in radians)</param>
/// <param name="aspect">Aspect ratio of the view (width / height)</param>
/// <param name="near">Distance to the near clip plane</param>
/// <param name="far">Distance to the far clip plane</param>
/// <returns>A projection matrix that transforms camera space to raster space</returns>
[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
/// <summary>
@ -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;

View file

@ -53,7 +53,7 @@ namespace OpenTK
/// Bottom row of the matrix
/// </summary>
public Vector4d Row3;
/// <summary>
/// The identity matrix
/// </summary>
@ -958,114 +958,6 @@ namespace OpenTK
CreateFromQuaternion(ref q, out result);
return result;
}
/// <summary>
/// Build a rotation matrix from the specified quaternion.
/// </summary>
/// <param name="q">Quaternion to translate.</param>
/// <param name="m">Matrix result.</param>
[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);
}
/// <summary>
/// Build a rotation matrix from the specified quaternion.
/// </summary>
/// <param name="q">Quaternion to translate.</param>
/// <returns>A matrix instance.</returns>
[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
/// <summary>
/// Build a translation matrix with the given translation
/// </summary>
/// <param name="trans">The vector to translate along</param>
/// <returns>A Translation matrix</returns>
[Obsolete("Use CreateTranslation instead.")]
public static Matrix4d Translation(Vector3d trans)
{
return Translation(trans.X, trans.Y, trans.Z);
}
/// <summary>
/// Build a translation matrix with the given translation
/// </summary>
/// <param name="x">X translation</param>
/// <param name="y">Y translation</param>
/// <param name="z">Z translation</param>
/// <returns>A Translation matrix</returns>
[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;

View file

@ -42,7 +42,7 @@ namespace OpenTK
/// The X, Y and Z components of this instance.
/// </summary>
public Vector3 Xyz;
/// <summary>
/// The W component of this instance.
/// </summary>
@ -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
/// <summary>
/// Gets or sets an OpenTK.Vector3 with the X, Y and Z components of this instance.
/// </summary>
[Obsolete("Use Xyz property instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
[XmlIgnore]
[CLSCompliant(false)]
public Vector3 XYZ { get { return Xyz; } set { Xyz = value; } }
#pragma warning restore 3005
/// <summary>
/// Gets or sets the X component of this instance.
/// </summary>
@ -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
/// <summary>
/// Multiplies two instances.
/// </summary>
/// <param name="left">The first instance.</param>
/// <param name="right">The second instance.</param>
/// <returns>A new instance containing the result of the calculation.</returns>
[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));
}
/// <summary>
/// Multiplies two instances.
/// </summary>
/// <param name="left">The first instance.</param>
/// <param name="right">The second instance.</param>
/// <param name="result">A new instance containing the result of the calculation.</param>
[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
/// <summary>
/// Multiplies two instances.
@ -662,7 +621,7 @@ namespace OpenTK
#region Slerp
/// <summary>
/// Do Spherical linear interpolation between two quaternions
/// Do Spherical linear interpolation between two quaternions
/// </summary>
/// <param name="q1">The first quaternion</param>
/// <param name="q2">The second quaternion</param>
@ -833,7 +792,7 @@ namespace OpenTK
#region public override bool Equals (object o)
/// <summary>
/// Compares this object instance to another object for equality.
/// Compares this object instance to another object for equality.
/// </summary>
/// <param name="other">The other object to be used in the comparison.</param>
/// <returns>True if both objects are Quaternions of equal value. Otherwise it returns false.</returns>
@ -848,7 +807,7 @@ namespace OpenTK
#region public override int GetHashCode ()
/// <summary>
/// Provides the hash code for this object.
/// Provides the hash code for this object.
/// </summary>
/// <returns>A hash code formed from the bitwise XOR of this objects members.</returns>
public override int GetHashCode()
@ -868,7 +827,7 @@ namespace OpenTK
#region IEquatable<Quaternion> Members
/// <summary>
/// Compares this Quaternion instance to another Quaternion for equality.
/// Compares this Quaternion instance to another Quaternion for equality.
/// </summary>
/// <param name="other">The other Quaternion to be used in the comparison.</param>
/// <returns>True if both instances are equal; false otherwise.</returns>

View file

@ -45,7 +45,7 @@ namespace OpenTK
/// <summary>
/// The W component of this instance.
/// </summary>
/// </summary>
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
/// <summary>
/// Gets or sets an OpenTK.Vector3d with the X, Y and Z components of this instance.
/// </summary>
[Obsolete("Use Xyz property instead.")]
[CLSCompliant(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[XmlIgnore]
public Vector3d XYZ { get { return Xyz; } set { Xyz = value; } }
#pragma warning restore 3005
/// <summary>
/// Gets or sets the X component of this instance.
/// </summary>
@ -143,7 +130,7 @@ namespace OpenTK
/// </summary>
[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
/// <summary>
/// Multiplies two instances.
/// </summary>
/// <param name="left">The first instance.</param>
/// <param name="right">The second instance.</param>
/// <returns>A new instance containing the result of the calculation.</returns>
[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));
}
/// <summary>
/// Multiplies two instances.
/// </summary>
/// <param name="left">The first instance.</param>
/// <param name="right">The second instance.</param>
/// <param name="result">A new instance containing the result of the calculation.</param>
[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
/// <summary>
/// Multiplies two instances.
@ -662,7 +621,7 @@ namespace OpenTK
#region Slerp
/// <summary>
/// Do Spherical linear interpolation between two quaternions
/// Do Spherical linear interpolation between two quaternions
/// </summary>
/// <param name="q1">The first Quaterniond</param>
/// <param name="q2">The second Quaterniond</param>
@ -727,7 +686,7 @@ namespace OpenTK
#endregion
#endregion
#region Operators
/// <summary>
@ -833,7 +792,7 @@ namespace OpenTK
#region public override bool Equals (object o)
/// <summary>
/// Compares this object instance to another object for equality.
/// Compares this object instance to another object for equality.
/// </summary>
/// <param name="other">The other object to be used in the comparison.</param>
/// <returns>True if both objects are Quaternions of equal value. Otherwise it returns false.</returns>
@ -848,7 +807,7 @@ namespace OpenTK
#region public override int GetHashCode ()
/// <summary>
/// Provides the hash code for this object.
/// Provides the hash code for this object.
/// </summary>
/// <returns>A hash code formed from the bitwise XOR of this objects members.</returns>
@ -883,7 +842,7 @@ namespace OpenTK
public double Z;
#endregion
#region Constructors
/// <summary>Constructs left Quaterniond that is left copy of the given Quaterniond.</summary>
@ -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
/// <summary>Returns the hash code for this instance.</summary>
@ -1441,7 +1400,7 @@ namespace OpenTK
}
#endregion
#region String and Parse
/// <summary>Returns the fully qualified type name of this instance.</summary>
@ -1466,7 +1425,7 @@ namespace OpenTK
}
#endregion
#region Constants
/// <summary>A quaterion with all zero components.</summary>
@ -1494,7 +1453,7 @@ namespace OpenTK
#region IEquatable<Quaterniond> Members
/// <summary>
/// Compares this Quaterniond instance to another Quaterniond for equality.
/// Compares this Quaterniond instance to another Quaterniond for equality.
/// </summary>
/// <param name="other">The other Quaterniond to be used in the comparison.</param>
/// <returns>True if both instances are equal; false otherwise.</returns>

View file

@ -73,39 +73,6 @@ namespace OpenTK
Y = y;
}
/// <summary>
/// Constructs a new Vector2 from the given Vector2.
/// </summary>
/// <param name="v">The Vector2 to copy components from.</param>
[Obsolete]
public Vector2(Vector2 v)
{
X = v.X;
Y = v.Y;
}
/// <summary>
/// Constructs a new Vector2 from the given Vector3.
/// </summary>
/// <param name="v">The Vector3 to copy components from. Z is discarded.</param>
[Obsolete]
public Vector2(Vector3 v)
{
X = v.X;
Y = v.Y;
}
/// <summary>
/// Constructs a new Vector2 from the given Vector4.
/// </summary>
/// <param name="v">The Vector4 to copy components from. Z and W are discarded.</param>
[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()
/// <summary>Add the Vector passed as parameter to this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[CLSCompliant(false)]
[Obsolete("Use static Add() method instead.")]
public void Add(Vector2 right)
{
this.X += right.X;
this.Y += right.Y;
}
/// <summary>Add the Vector passed as parameter to this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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()
/// <summary>Subtract the Vector passed as parameter from this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[CLSCompliant(false)]
[Obsolete("Use static Subtract() method instead.")]
public void Sub(Vector2 right)
{
this.X -= right.X;
this.Y -= right.Y;
}
/// <summary>Subtract the Vector passed as parameter from this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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()
/// <summary>Multiply this instance by a scalar.</summary>
/// <param name="f">Scalar operand.</param>
[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()
/// <summary>Divide this instance by a scalar.</summary>
/// <param name="f">Scalar operand.</param>
[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
/// <summary>
@ -329,42 +221,6 @@ namespace OpenTK
#endregion
#region public void Scale()
/// <summary>
/// Scales the current Vector2 by the given amounts.
/// </summary>
/// <param name="sx">The scale of the X component.</param>
/// <param name="sy">The scale of the Y component.</param>
[Obsolete("Use static Multiply() method instead.")]
public void Scale(float sx, float sy)
{
this.X = X * sx;
this.Y = Y * sy;
}
/// <summary>Scales this instance by the given parameter.</summary>
/// <param name="scale">The scaling of the individual components.</param>
[CLSCompliant(false)]
[Obsolete("Use static Multiply() method instead.")]
public void Scale(Vector2 scale)
{
this.X *= scale.X;
this.Y *= scale.Y;
}
/// <summary>Scales this instance by the given parameter.</summary>
/// <param name="scale">The scaling of the individual components.</param>
[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
/// <summary>
/// Subtract one Vector from another
/// </summary>
/// <param name="a">First operand</param>
/// <param name="b">Second operand</param>
/// <returns>Result of subtraction</returns>
[Obsolete("Use static Subtract() method instead.")]
public static Vector2 Sub(Vector2 a, Vector2 b)
{
a.X -= b.X;
a.Y -= b.Y;
return a;
}
/// <summary>
/// Subtract one Vector from another
/// </summary>
/// <param name="a">First operand</param>
/// <param name="b">Second operand</param>
/// <param name="result">Result of subtraction</param>
[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
/// <summary>
/// Multiply a vector and a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <returns>Result of the multiplication</returns>
[Obsolete("Use static Multiply() method instead.")]
public static Vector2 Mult(Vector2 a, float f)
{
a.X *= f;
a.Y *= f;
return a;
}
/// <summary>
/// Multiply a vector and a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <param name="result">Result of the multiplication</param>
[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
/// <summary>
/// Divide a vector by a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <returns>Result of the division</returns>
[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;
}
/// <summary>
/// Divide a vector by a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <param name="result">Result of the division</param>
[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
/// <summary>

View file

@ -110,81 +110,6 @@ namespace OpenTK
#region Instance
#region public void Add()
/// <summary>Add the Vector passed as parameter to this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[CLSCompliant(false)]
[Obsolete("Use static Add() method instead.")]
public void Add(Vector2d right)
{
this.X += right.X;
this.Y += right.Y;
}
/// <summary>Add the Vector passed as parameter to this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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()
/// <summary>Subtract the Vector passed as parameter from this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[CLSCompliant(false)]
[Obsolete("Use static Subtract() method instead.")]
public void Sub(Vector2d right)
{
this.X -= right.X;
this.Y -= right.Y;
}
/// <summary>Subtract the Vector passed as parameter from this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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()
/// <summary>Multiply this instance by a scalar.</summary>
/// <param name="f">Scalar operand.</param>
[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()
/// <summary>Divide this instance by a scalar.</summary>
/// <param name="f">Scalar operand.</param>
[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
/// <summary>
@ -276,145 +201,6 @@ namespace OpenTK
#endregion
#region public void Scale()
/// <summary>
/// Scales the current Vector2 by the given amounts.
/// </summary>
/// <param name="sx">The scale of the X component.</param>
/// <param name="sy">The scale of the Y component.</param>
[Obsolete("Use static Multiply() method instead.")]
public void Scale(double sx, double sy)
{
X *= sx;
Y *= sy;
}
/// <summary>Scales this instance by the given parameter.</summary>
/// <param name="scale">The scaling of the individual components.</param>
[CLSCompliant(false)]
[Obsolete("Use static Multiply() method instead.")]
public void Scale(Vector2d scale)
{
this.X *= scale.X;
this.Y *= scale.Y;
}
/// <summary>Scales this instance by the given parameter.</summary>
/// <param name="scale">The scaling of the individual components.</param>
[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
/// <summary>
/// Subtract one Vector from another
/// </summary>
/// <param name="a">First operand</param>
/// <param name="b">Second operand</param>
/// <returns>Result of subtraction</returns>
[Obsolete("Use static Subtract() method instead.")]
public static Vector2d Sub(Vector2d a, Vector2d b)
{
a.X -= b.X;
a.Y -= b.Y;
return a;
}
/// <summary>
/// Subtract one Vector from another
/// </summary>
/// <param name="a">First operand</param>
/// <param name="b">Second operand</param>
/// <param name="result">Result of subtraction</param>
[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
/// <summary>
/// Multiply a vector and a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="d">Scalar operand</param>
/// <returns>Result of the multiplication</returns>
[Obsolete("Use static Multiply() method instead.")]
public static Vector2d Mult(Vector2d a, double d)
{
a.X *= d;
a.Y *= d;
return a;
}
/// <summary>
/// Multiply a vector and a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="d">Scalar operand</param>
/// <param name="result">Result of the multiplication</param>
[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
/// <summary>
/// Divide a vector by a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="d">Scalar operand</param>
/// <returns>Result of the division</returns>
[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;
}
/// <summary>
/// Divide a vector by a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="d">Scalar operand</param>
/// <param name="result">Result of the division</param>
[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
/// <summary>

View file

@ -140,87 +140,6 @@ namespace OpenTK
#region Instance
#region public void Add()
/// <summary>Add the Vector passed as parameter to this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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;
}
/// <summary>Add the Vector passed as parameter to this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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()
/// <summary>Subtract the Vector passed as parameter from this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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;
}
/// <summary>Subtract the Vector passed as parameter from this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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()
/// <summary>Multiply this instance by a scalar.</summary>
/// <param name="f">Scalar operand.</param>
[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()
/// <summary>Divide this instance by a scalar.</summary>
/// <param name="f">Scalar operand.</param>
[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
/// <summary>
@ -320,46 +239,6 @@ namespace OpenTK
#endregion
#region public void Scale()
/// <summary>
/// Scales the current Vector3 by the given amounts.
/// </summary>
/// <param name="sx">The scale of the X component.</param>
/// <param name="sy">The scale of the Y component.</param>
/// <param name="sz">The scale of the Z component.</param>
[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;
}
/// <summary>Scales this instance by the given parameter.</summary>
/// <param name="scale">The scaling of the individual components.</param>
[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;
}
/// <summary>Scales this instance by the given parameter.</summary>
/// <param name="scale">The scaling of the individual components.</param>
[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
/// <summary>
/// Subtract one Vector from another
/// </summary>
/// <param name="a">First operand</param>
/// <param name="b">Second operand</param>
/// <returns>Result of subtraction</returns>
[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;
}
/// <summary>
/// Subtract one Vector from another
/// </summary>
/// <param name="a">First operand</param>
/// <param name="b">Second operand</param>
/// <param name="result">Result of subtraction</param>
[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
/// <summary>
/// Multiply a vector and a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <returns>Result of the multiplication</returns>
[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;
}
/// <summary>
/// Multiply a vector and a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <param name="result">Result of the multiplication</param>
[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
/// <summary>
/// Divide a vector by a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <returns>Result of the division</returns>
[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;
}
/// <summary>
/// Divide a vector by a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <param name="result">Result of the division</param>
[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
/// <summary>

View file

@ -137,87 +137,6 @@ namespace OpenTK
#region Instance
#region public void Add()
/// <summary>Add the Vector passed as parameter to this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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;
}
/// <summary>Add the Vector passed as parameter to this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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()
/// <summary>Subtract the Vector passed as parameter from this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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;
}
/// <summary>Subtract the Vector passed as parameter from this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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()
/// <summary>Multiply this instance by a scalar.</summary>
/// <param name="f">Scalar operand.</param>
[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()
/// <summary>Divide this instance by a scalar.</summary>
/// <param name="f">Scalar operand.</param>
[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
/// <summary>
@ -318,46 +237,6 @@ namespace OpenTK
#endregion
#region public void Scale()
/// <summary>
/// Scales the current Vector3d by the given amounts.
/// </summary>
/// <param name="sx">The scale of the X component.</param>
/// <param name="sy">The scale of the Y component.</param>
/// <param name="sz">The scale of the Z component.</param>
[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;
}
/// <summary>Scales this instance by the given parameter.</summary>
/// <param name="scale">The scaling of the individual components.</param>
[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;
}
/// <summary>Scales this instance by the given parameter.</summary>
/// <param name="scale">The scaling of the individual components.</param>
[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
/// <summary>
/// Subtract one Vector from another
/// </summary>
/// <param name="a">First operand</param>
/// <param name="b">Second operand</param>
/// <returns>Result of subtraction</returns>
[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;
}
/// <summary>
/// Subtract one Vector from another
/// </summary>
/// <param name="a">First operand</param>
/// <param name="b">Second operand</param>
/// <param name="result">Result of subtraction</param>
[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
/// <summary>
/// Multiply a vector and a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <returns>Result of the multiplication</returns>
[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;
}
/// <summary>
/// Multiply a vector and a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <param name="result">Result of the multiplication</param>
[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
/// <summary>
/// Divide a vector by a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <returns>Result of the division</returns>
[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;
}
/// <summary>
/// Divide a vector by a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <param name="result">Result of the division</param>
[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
/// <summary>

View file

@ -200,93 +200,6 @@ namespace OpenTK
#region Instance
#region public void Add()
/// <summary>Add the Vector passed as parameter to this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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;
}
/// <summary>Add the Vector passed as parameter to this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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()
/// <summary>Subtract the Vector passed as parameter from this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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;
}
/// <summary>Subtract the Vector passed as parameter from this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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()
/// <summary>Multiply this instance by a scalar.</summary>
/// <param name="f">Scalar operand.</param>
[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()
/// <summary>Divide this instance by a scalar.</summary>
/// <param name="f">Scalar operand.</param>
[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
/// <summary>
@ -388,157 +301,10 @@ namespace OpenTK
#endregion
#region public void Scale()
/// <summary>
/// Scales the current Vector4 by the given amounts.
/// </summary>
/// <param name="sx">The scale of the X component.</param>
/// <param name="sy">The scale of the Y component.</param>
/// <param name="sz">The scale of the Z component.</param>
/// <param name="sw">The scale of the Z component.</param>
[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;
}
/// <summary>Scales this instance by the given parameter.</summary>
/// <param name="scale">The scaling of the individual components.</param>
[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;
}
/// <summary>Scales this instance by the given parameter.</summary>
/// <param name="scale">The scaling of the individual components.</param>
[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
/// <summary>
/// Subtract one Vector from another
/// </summary>
/// <param name="a">First operand</param>
/// <param name="b">Second operand</param>
/// <returns>Result of subtraction</returns>
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;
}
/// <summary>
/// Subtract one Vector from another
/// </summary>
/// <param name="a">First operand</param>
/// <param name="b">Second operand</param>
/// <param name="result">Result of subtraction</param>
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
/// <summary>
/// Multiply a vector and a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <returns>Result of the multiplication</returns>
public static Vector4 Mult(Vector4 a, float f)
{
a.X *= f;
a.Y *= f;
a.Z *= f;
a.W *= f;
return a;
}
/// <summary>
/// Multiply a vector and a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <param name="result">Result of the multiplication</param>
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
/// <summary>
/// Divide a vector by a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <returns>Result of the division</returns>
public static Vector4 Div(Vector4 a, float f)
{
a.X /= f;
a.Y /= f;
a.Z /= f;
a.W /= f;
return a;
}
/// <summary>
/// Divide a vector by a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <param name="result">Result of the division</param>
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
/// <summary>

View file

@ -197,93 +197,6 @@ namespace OpenTK
#region Instance
#region public void Add()
/// <summary>Add the Vector passed as parameter to this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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;
}
/// <summary>Add the Vector passed as parameter to this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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()
/// <summary>Subtract the Vector passed as parameter from this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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;
}
/// <summary>Subtract the Vector passed as parameter from this instance.</summary>
/// <param name="right">Right operand. This parameter is only read from.</param>
[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()
/// <summary>Multiply this instance by a scalar.</summary>
/// <param name="f">Scalar operand.</param>
[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()
/// <summary>Divide this instance by a scalar.</summary>
/// <param name="f">Scalar operand.</param>
[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
/// <summary>
@ -384,165 +297,10 @@ namespace OpenTK
#endregion
#region public void Scale()
/// <summary>
/// Scales the current Vector4d by the given amounts.
/// </summary>
/// <param name="sx">The scale of the X component.</param>
/// <param name="sy">The scale of the Y component.</param>
/// <param name="sz">The scale of the Z component.</param>
/// <param name="sw">The scale of the Z component.</param>
[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;
}
/// <summary>Scales this instance by the given parameter.</summary>
/// <param name="scale">The scaling of the individual components.</param>
[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;
}
/// <summary>Scales this instance by the given parameter.</summary>
/// <param name="scale">The scaling of the individual components.</param>
[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
/// <summary>
/// Subtract one Vector from another
/// </summary>
/// <param name="a">First operand</param>
/// <param name="b">Second operand</param>
/// <returns>Result of subtraction</returns>
[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;
}
/// <summary>
/// Subtract one Vector from another
/// </summary>
/// <param name="a">First operand</param>
/// <param name="b">Second operand</param>
/// <param name="result">Result of subtraction</param>
[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
/// <summary>
/// Multiply a vector and a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <returns>Result of the multiplication</returns>
[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;
}
/// <summary>
/// Multiply a vector and a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <param name="result">Result of the multiplication</param>
[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
/// <summary>
/// Divide a vector by a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <returns>Result of the division</returns>
[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;
}
/// <summary>
/// Divide a vector by a scalar
/// </summary>
/// <param name="a">Vector operand</param>
/// <param name="f">Scalar operand</param>
/// <param name="result">Result of the division</param>
[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
/// <summary>

View file

@ -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
/// <summary>
/// Transforms the specified point from screen to client coordinates.
/// Transforms the specified point from screen to client coordinates.
/// </summary>
/// <param name="point">
/// A <see cref="System.Drawing.Point"/> to transform.
@ -367,23 +367,6 @@ namespace OpenTK
#endregion
#region InputDriver
/// <summary>
/// This property is deprecated.
/// </summary>
[Obsolete]
public IInputDriver InputDriver
{
get
{
EnsureUndisposed();
return implementation.InputDriver;
}
}
#endregion
#region Location
/// <summary>
@ -630,7 +613,7 @@ namespace OpenTK
public event EventHandler<EventArgs> FocusedChanged = delegate { };
/// <summary>
/// Occurs when the <see cref="Icon"/> property of the window changes.
/// Occurs when the <see cref="Icon"/> property of the window changes.
/// </summary>
public event EventHandler<EventArgs> IconChanged = delegate { };
@ -658,7 +641,7 @@ namespace OpenTK
/// Occurs whenever the mouse cursor enters the window <see cref="Bounds"/>.
/// </summary>
public event EventHandler<EventArgs> MouseEnter = delegate { };
/// <summary>
/// Occurs whenever the mouse cursor leaves the window <see cref="Bounds"/>.
/// </summary>

View file

@ -224,9 +224,6 @@
<Compile Include="Platform\Utilities.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Platform\INativeGLWindow.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Platform\DesktopGraphicsContext.cs">
<SubType>Code</SubType>
</Compile>
@ -440,15 +437,6 @@
<Compile Include="Input\Key.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Input\IJoystickDriver.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Input\IMouseDriver.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Input\IInputDriver.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Input\KeyboardDevice.cs">
<SubType>Code</SubType>
</Compile>
@ -461,9 +449,6 @@
<Compile Include="Input\JoystickDevice.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Input\IKeyboardDriver.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Input\KeyboardKeyEventArgs.cs">
<SubType>Code</SubType>
</Compile>
@ -494,9 +479,6 @@
<Compile Include="Math\Vector3.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Math\Functions.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Math\Matrix4d.cs">
<SubType>Code</SubType>
</Compile>
@ -722,7 +704,6 @@
<Compile Include="Input\ConfigurationType.cs" />
<Compile Include="Input\GamePadConfigurationSource.cs" />
<Compile Include="Input\GamePadConfigurationItem.cs" />
<Compile Include="Platform\LegacyJoystickDriver.cs" />
<Compile Include="Platform\PlatformFactoryBase.cs" />
<Compile Include="Input\JoystickHat.cs" />
<Compile Include="Input\HatPosition.cs" />
@ -742,7 +723,6 @@
<Compile Include="Platform\MacOS\Cocoa\NSOpenGLPixelFormatAttribute.cs" />
<Compile Include="Platform\MacOS\Cocoa\NSOpenGLProfile.cs" />
<Compile Include="Platform\MacOS\Cocoa\NSOpenGLContextParameter.cs" />
<Compile Include="Platform\LegacyInputDriver.cs" />
<Compile Include="Platform\MacOS\Cocoa\NSEventType.cs" />
<Compile Include="Platform\MacOS\Cocoa\NSEventModifierMask.cs" />
<Compile Include="Platform\MacOS\Cocoa\NSTrackingAreaOptions.cs" />
@ -822,4 +802,4 @@
</Properties>
</MonoDevelop>
</ProjectExtensions>
</Project>
</Project>

View file

@ -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)

View file

@ -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);
}

View file

@ -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);
}
}

View file

@ -1,119 +0,0 @@
#region License
//
// LegacyInputDriver.cs
//
// Author:
// Stefanos A. <stapostol@gmail.com>
//
// 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<KeyboardDevice> dummy_keyboard_list = new List<KeyboardDevice>(1);
List<MouseDevice> dummy_mice_list = new List<MouseDevice>(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<KeyboardDevice> Keyboard
{
get { return dummy_keyboard_list; }
}
#endregion
#region IMouseDriver Members
public IList<MouseDevice> Mouse
{
get { return dummy_mice_list; }
}
#endregion
#region IJoystickDriver Members
public IList<JoystickDevice> Joysticks
{
get { return JoystickDriver.Joysticks; }
}
#endregion
#region IDisposable Members
public void Dispose()
{
}
#endregion
}
}

View file

@ -1,136 +0,0 @@
#region License
//
// LegacyJoystickDriver.cs
//
// Author:
// Stefanos A. <stapostol@gmail.com>
//
// 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<JoystickDevice> joysticks = new List<JoystickDevice>();
readonly IList<JoystickDevice> 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<JoystickDevice> Joysticks
{
get
{
Poll();
return joysticks_readonly;
}
}
#endregion
}
}

View file

@ -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; }

View file

@ -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)

View file

@ -222,28 +222,6 @@ namespace OpenTK.Platform
#region --- Creating a Graphics Context ---
/// <summary>
/// Creates an IGraphicsContext instance for the specified window.
/// </summary>
/// <param name="mode">The GraphicsMode for the GraphicsContext.</param>
/// <param name="window">An IWindowInfo instance describing the parent window for this IGraphicsContext.</param>
/// <param name="major">The major OpenGL version number for this IGraphicsContext.</param>
/// <param name="minor">The minor OpenGL version number for this IGraphicsContext.</param>
/// <param name="flags">A bitwise collection of GraphicsContextFlags with specific options for this IGraphicsContext.</param>
/// <returns>A new IGraphicsContext instance.</returns>
[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
/// <summary>
@ -318,7 +296,7 @@ namespace OpenTK.Platform
/// <param name="xOffset">The X offset for the GL viewport</param>
/// <param name="yOffset">The Y offset for the GL viewport</param>
/// <returns>A new IWindowInfo instance.</returns>
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__
/// <summary>
/// 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).
/// </summary>
/// <param name="platformWindow"></param>

View file

@ -632,75 +632,6 @@ XF86VidModeGetGammaRampSize(
#endregion
#region internal class SetWindowAttributes
[StructLayout(LayoutKind.Sequential), Obsolete("Use XSetWindowAttributes instead")]
internal class SetWindowAttributes
{
/// <summary>
/// background, None, or ParentRelative
/// </summary>
public Pixmap background_pixmap;
/// <summary>
/// background pixel
/// </summary>
public long background_pixel;
/// <summary>
/// border of the window or CopyFromParent
/// </summary>
public Pixmap border_pixmap;
/// <summary>
/// border pixel value
/// </summary>
public long border_pixel;
/// <summary>
/// one of bit gravity values
/// </summary>
public int bit_gravity;
/// <summary>
/// one of the window gravity values
/// </summary>
public int win_gravity;
/// <summary>
/// NotUseful, WhenMapped, Always
/// </summary>
public int backing_store;
/// <summary>
/// planes to be preserved if possible
/// </summary>
public long backing_planes;
/// <summary>
/// value to use in restoring planes
/// </summary>
public long backing_pixel;
/// <summary>
/// should bits under be saved? (popups)
/// </summary>
public bool save_under;
/// <summary>
/// set of events that should be saved
/// </summary>
public EventMask event_mask;
/// <summary>
/// set of events that should not propagate
/// </summary>
public long do_not_propagate_mask;
/// <summary>
/// boolean value for override_redirect
/// </summary>
public bool override_redirect;
/// <summary>
/// color map to be associated with window
/// </summary>
public Colormap colormap;
/// <summary>
/// cursor to be displayed (or None)
/// </summary>
public Cursor cursor;
}
#endregion
#region internal struct SizeHints
[StructLayout(LayoutKind.Sequential)]