mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-24 12:31:00 +00:00
Merge pull request #549 from Nihlus/remove-obsolete-code
Remove code marked obsolete
This commit is contained in:
commit
7bf31b18e1
|
@ -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);
|
||||
|
|
|
@ -319,8 +319,6 @@ 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
|
||||
|
|
|
@ -483,38 +483,6 @@ namespace OpenTK
|
|||
|
||||
#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
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -79,12 +79,6 @@ 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;
|
||||
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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,223 +1361,6 @@ 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
|
||||
}
|
||||
|
||||
|
|
|
@ -128,12 +128,6 @@ namespace OpenTK
|
|||
/// </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>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -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; }
|
||||
}
|
||||
}
|
|
@ -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; }
|
||||
}
|
||||
}
|
|
@ -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; }
|
||||
}
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
|
@ -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>
|
||||
|
|
|
@ -959,114 +959,6 @@ namespace OpenTK
|
|||
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
|
||||
|
||||
#region Scale Functions
|
||||
|
|
|
@ -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>
|
||||
|
@ -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.
|
||||
|
|
|
@ -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>
|
||||
|
@ -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.
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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" />
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -53,9 +53,6 @@ namespace OpenTK.Platform
|
|||
|
||||
Input.IJoystickDriver2 CreateJoystickDriver();
|
||||
|
||||
[Obsolete]
|
||||
Input.IJoystickDriver CreateLegacyJoystickDriver();
|
||||
|
||||
void RegisterResource(IDisposable resource);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
@ -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; }
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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)]
|
||||
|
|
Loading…
Reference in a new issue