From 9265747541392637559e2be9e19c35aabd30a310 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Wed, 25 Mar 2009 21:53:12 +0000 Subject: [PATCH] Fixed all known build warnings, apart from missing xml comments. --- Source/OpenTK/Audio/AudioContext.cs | 53 ++-- Source/OpenTK/Audio/OpenAL/AL/AL.cs | 27 +- .../Audio/OpenAL/AL/EffectsExtension.cs | 15 +- Source/OpenTK/Audio/OpenAL/Alc/Alc.cs | 4 +- Source/OpenTK/Audio/OpenAL/Alut/Alut.cs | 2 +- Source/OpenTK/Audio/SoundData.cs | 3 +- Source/OpenTK/GLControl.cs | 4 +- Source/OpenTK/GameWindow.cs | 15 +- Source/OpenTK/Graphics/DisplayDevice.cs | 12 +- Source/OpenTK/Graphics/GL/GL.cs | 2 + Source/OpenTK/Graphics/GL/GLHelper.cs | 9 +- Source/OpenTK/Graphics/Glu/GluHelper.cs | 2 +- Source/OpenTK/Graphics/GraphicsContext.cs | 5 +- Source/OpenTK/Input/JoystickDevice.cs | 6 +- Source/OpenTK/Input/MouseDevice.cs | 2 +- Source/OpenTK/Math/Functions.cs | 2 +- Source/OpenTK/Math/Matrix4.cs | 8 +- Source/OpenTK/Math/Matrix4d.cs | 8 +- Source/OpenTK/Math/Quaternion.cs | 6 +- Source/OpenTK/Math/Quaterniond.cs | 6 +- Source/OpenTK/Math/Vector2.cs | 7 +- Source/OpenTK/Math/Vector2d.cs | 11 +- Source/OpenTK/Math/Vector2h.cs | 9 +- Source/OpenTK/Math/Vector3.cs | 235 +++++++++--------- Source/OpenTK/Math/Vector3d.cs | 233 +++++++++-------- Source/OpenTK/Math/Vector3h.cs | 9 +- Source/OpenTK/Math/Vector4.cs | 11 +- Source/OpenTK/Math/Vector4d.cs | 168 +++++++------ Source/OpenTK/Math/Vector4h.cs | 1 - Source/OpenTK/Platform/MacOS/AglContext.cs | 3 +- .../OpenTK/Platform/MacOS/CarbonGLNative.cs | 6 +- Source/OpenTK/Platform/Utilities.cs | 4 +- Source/OpenTK/Platform/Windows/API.cs | 22 +- Source/OpenTK/Platform/Windows/WglHelper.cs | 2 +- .../OpenTK/Platform/Windows/WinMMJoystick.cs | 29 +-- Source/OpenTK/Platform/X11/API.cs | 2 +- Source/OpenTK/Platform/X11/Structs.cs | 2 +- 37 files changed, 480 insertions(+), 465 deletions(-) diff --git a/Source/OpenTK/Audio/AudioContext.cs b/Source/OpenTK/Audio/AudioContext.cs index c10b8e59..e84b3c7c 100644 --- a/Source/OpenTK/Audio/AudioContext.cs +++ b/Source/OpenTK/Audio/AudioContext.cs @@ -23,7 +23,7 @@ namespace OpenTK.Audio #region --- Fields --- bool disposed; - bool is_processing; + bool is_processing, is_synchronized; IntPtr device_handle; ContextHandle context_handle; bool context_exists; @@ -62,7 +62,6 @@ namespace OpenTK.Audio #region public AudioContext() /// Constructs a new AudioContext, using the default audio device. - /// Occurs when no audio devices are available. public AudioContext() : this(null, 0, 0, false, true) { } @@ -89,7 +88,6 @@ namespace OpenTK.Audio /// Use AudioContext.AvailableDevices to obtain a list of all available audio devices. /// devices. /// - /// public AudioContext(string device, int freq) : this(device, freq, 0, false, true) { } #endregion @@ -104,7 +102,6 @@ namespace OpenTK.Audio /// Use AudioContext.AvailableDevices to obtain a list of all available audio devices. /// devices. /// - /// public AudioContext(string device, int freq, int refresh) : this(device, freq, refresh, false, true) { } @@ -121,13 +118,12 @@ namespace OpenTK.Audio /// Use AudioContext.AvailableDevices to obtain a list of all available audio devices. /// devices. /// - /// public AudioContext(string device, int freq, int refresh, bool sync) : this(available_devices[0], freq, refresh, sync, true) { } #endregion - #region public AudioContext(string device, int freq, int refresh, bool sync, int maxSends) + #region public AudioContext(string device, int freq, int refresh, bool sync, bool enableEfx) /// Creates the audio context using the specified device and device parameters. /// The device descriptor obtained through AudioContext.AvailableDevices. @@ -137,10 +133,10 @@ namespace OpenTK.Audio /// Indicates whether the EFX extension should be initialized, if present. /// Occurs when the device string is invalid. /// Occurs when a specified parameter is invalid. - /// + /// /// Occurs when the specified device is not available, or is in use by another program. /// - /// + /// /// Occurs when an audio context could not be created with the specified parameters. /// /// @@ -228,7 +224,7 @@ namespace OpenTK.Audio /// /// Occurs when the specified device is not available, or is in use by another program. /// - /// + /// /// Occurs when an audio context could not be created with the specified parameters. /// /// @@ -267,8 +263,6 @@ namespace OpenTK.Audio CheckForAlcErrors(); - device_name = Alc.GetString(device_handle, AlcGetString.DeviceSpecifier); - // Build the attribute list List attributes = new List(); @@ -314,8 +308,22 @@ namespace OpenTK.Audio CheckForAlcErrors(); - //device_name = Alc.GetString(device_handle, AlcGetString.DeviceSpecifier); - //Debug.Print(device_name); + device_name = Alc.GetString(device_handle, AlcGetString.DeviceSpecifier); + int attribute_count; + Alc.GetInteger(device_handle, AlcGetInteger.AttributesSize, sizeof(int), out attribute_count); + if (attribute_count > 0) + { + int[] device_attributes = new int[attribute_count]; + Alc.GetInteger(device_handle, AlcGetInteger.AllAttributes, device_attributes.Length * sizeof(int), out device_attributes[0]); + foreach (int attr in device_attributes) + { + switch ((AlcContextAttributes)attr) + { + case AlcContextAttributes.Sync: IsSynchronized = true; break; + } + } + } + lock (audio_context_lock) { available_contexts.Add(this.context_handle, this); @@ -439,6 +447,21 @@ namespace OpenTK.Audio #endregion + #region public bool IsProcessing + + /// + /// Gets a System.Boolean indicating whether the AudioContext is + /// synchronized. + /// + /// + public bool IsSynchronized + { + get { return is_synchronized; } + private set { is_synchronized = value; } + } + + #endregion + #region public void Process /// @@ -457,7 +480,7 @@ namespace OpenTK.Audio /// /// Occurs when this function is called after the AudioContext had been disposed. /// - /// + /// /// public void Process() { @@ -488,7 +511,7 @@ namespace OpenTK.Audio /// /// Occurs when this function is called after the AudioContext had been disposed. /// - /// + /// /// public void Suspend() { diff --git a/Source/OpenTK/Audio/OpenAL/AL/AL.cs b/Source/OpenTK/Audio/OpenAL/AL/AL.cs index c4265075..7cdea668 100644 --- a/Source/OpenTK/Audio/OpenAL/AL/AL.cs +++ b/Source/OpenTK/Audio/OpenAL/AL/AL.cs @@ -1180,7 +1180,7 @@ namespace OpenTK.Audio } /// This function queues a set of buffers on a source. All buffers attached to a source will be played in sequence, and the number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed. When first created, a source will be of type ALSourceType.Undetermined. A successful AL.SourceQueueBuffers call will change the source type to ALSourceType.Streaming. - /// The name of the source to queue buffers onto. + /// The name of the source to queue buffers onto. /// The name of the buffer to be queued. public static void SourceQueueBuffer(int source, int buffer) { @@ -1315,7 +1315,7 @@ namespace OpenTK.Audio } /// This function generates one buffer only, which contain audio data (see AL.BufferData). References to buffers are uint values, which are used wherever a buffer reference is needed (in calls such as AL.DeleteBuffers, AL.Source with parameter ALSourcei, AL.SourceQueueBuffers, and AL.SourceUnqueueBuffers). - /// Pointer to an uint value which will store the names of the new buffer. + /// Pointer to an uint value which will store the names of the new buffer. [CLSCompliant(false)] public static void GenBuffer(out uint buffer) { @@ -1349,7 +1349,7 @@ namespace OpenTK.Audio public static extern void DeleteBuffers(int n, [In] ref int buffers); /// This function deletes one buffer only, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source. - /// Pointer to a buffer name identifying the buffer to be deleted. + /// Pointer to a buffer name identifying the buffer to be deleted. [CLSCompliant(false)] public static void DeleteBuffers(uint[] buffers) { @@ -1359,7 +1359,6 @@ namespace OpenTK.Audio } /// This function deletes one or more buffers, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source. - /// The number of buffers to be deleted. /// Pointer to an array of buffer names identifying the buffers to be deleted. [CLSCompliant(true)] public static void DeleteBuffers(int[] buffers) @@ -1390,14 +1389,14 @@ namespace OpenTK.Audio #region IsBuffer /// This function tests if a buffer name is valid, returning True if valid, False if not. - /// A buffer Handle previously allocated with . + /// A buffer Handle previously allocated with . /// Success. [CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alIsBuffer", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static extern bool IsBuffer(uint bid); // AL_API ALboolean AL_APIENTRY alIsBuffer( ALuint bid ); /// This function tests if a buffer name is valid, returning True if valid, False if not. - /// A buffer Handle previously allocated with . + /// A buffer Handle previously allocated with . /// Success. [CLSCompliant(true)] public static bool IsBuffer(int bid) @@ -1417,7 +1416,7 @@ namespace OpenTK.Audio /// The size of the audio buffer in bytes. /// The frequency of the audio buffer. [CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alBufferData", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] - public static extern void BufferData(uint bid, ALFormat format, IntPtr data, int size, int freq); + public static extern void BufferData(uint bid, ALFormat format, IntPtr buffer, int size, int freq); // AL_API void AL_APIENTRY alBufferData( ALuint bid, ALenum format, const ALvoid* buffer, ALsizei size, ALsizei freq ); /// This function fills a buffer with audio buffer. All the pre-defined formats are PCM buffer, but this function may be used by extensions to load other buffer types as well. @@ -1427,28 +1426,28 @@ namespace OpenTK.Audio /// The size of the audio buffer in bytes. /// The frequency of the audio buffer. [CLSCompliant(true)] - public static void BufferData(int bid, ALFormat format, IntPtr data, int size, int freq) + public static void BufferData(int bid, ALFormat format, IntPtr buffer, int size, int freq) { - BufferData((uint)bid, format, data, size, freq); + BufferData((uint)bid, format, buffer, size, freq); } /// This function fills a buffer with audio buffer (PCM format). /// Buffer Handle/Name to be filled with buffer. /// A SoundData object containing the buffer to upload. [CLSCompliant(false)] - public static void BufferData(uint bid, SoundData data) + public static void BufferData(uint bid, SoundData buffer) { unsafe { - fixed (byte* data_ptr = &data.Data[0]) - BufferData(bid, data.SoundFormat.SampleFormatAsOpenALFormat, (IntPtr)data_ptr, data.Data.Length, - data.SoundFormat.SampleRate); + fixed (byte* data_ptr = &buffer.Data[0]) + BufferData(bid, buffer.SoundFormat.SampleFormatAsOpenALFormat, (IntPtr)data_ptr, buffer.Data.Length, + buffer.SoundFormat.SampleRate); } } /// This function fills a buffer with audio buffer (PCM format). /// Buffer Handle/Name to be filled with buffer. - /// A SoundData object containing the buffer to upload. + /// A SoundData object containing the buffer to upload. public static void BufferData(int bid, SoundData data) { unsafe diff --git a/Source/OpenTK/Audio/OpenAL/AL/EffectsExtension.cs b/Source/OpenTK/Audio/OpenAL/AL/EffectsExtension.cs index 69926139..a2a26b42 100644 --- a/Source/OpenTK/Audio/OpenAL/AL/EffectsExtension.cs +++ b/Source/OpenTK/Audio/OpenAL/AL/EffectsExtension.cs @@ -494,8 +494,8 @@ namespace OpenTK.Audio /// This function is used to retrieve 3 floating point properties from Effect objects. /// Effect object identifier. - /// Effect property to retrieve. - /// A Math.Vector3 to hold the values. + /// Effect property to retrieve. + /// A Math.Vector3 to hold the values. [CLSCompliant(false)] public void GetEffect(uint eid, EfxEffect3f param, out Vector3 values) { @@ -513,8 +513,8 @@ namespace OpenTK.Audio /// This function is used to retrieve 3 floating point properties from Effect objects. /// Effect object identifier. - /// Effect property to retrieve. - /// A Math.Vector3 to hold the values. + /// Effect property to retrieve. + /// A Math.Vector3 to hold the values. public void GetEffect(int eid, EfxEffect3f param, out Vector3 values) { @@ -652,7 +652,7 @@ namespace OpenTK.Audio } /// This function deletes one Filter only. - /// Pointer to an filter name/handle identifying the Filter Object to be deleted. + /// Pointer to an filter name/handle identifying the Filter Object to be deleted. [CLSCompliant(false)] public void DeleteFilters(uint[] filters) { @@ -661,7 +661,7 @@ namespace OpenTK.Audio } /// This function deletes one Filter only. - /// Pointer to an filter name/handle identifying the Filter Object to be deleted. + /// Pointer to an filter name/handle identifying the Filter Object to be deleted. public void DeleteFilters(int[] filters) { if (filters == null) throw new ArgumentNullException("filters"); @@ -983,7 +983,6 @@ namespace OpenTK.Audio } /// The DeleteAuxiliaryEffectSlots function is used to delete and free resources for Auxiliary Effect Slots previously created with GenAuxiliaryEffectSlots. - /// Number of Auxiliary Effect Slots to be deleted. /// Pointer to n Effect Slot object identifiers. public void DeleteAuxiliaryEffectSlots(int[] slots) { @@ -992,7 +991,7 @@ namespace OpenTK.Audio } /// This function deletes one AuxiliaryEffectSlot only. - /// Pointer to an auxiliary effect slot name/handle identifying the Auxiliary Effect Slot Object to be deleted. + /// Pointer to an auxiliary effect slot name/handle identifying the Auxiliary Effect Slot Object to be deleted. [CLSCompliant(false)] public void DeleteAuxiliaryEffectSlots(uint[] slots) { diff --git a/Source/OpenTK/Audio/OpenAL/Alc/Alc.cs b/Source/OpenTK/Audio/OpenAL/Alc/Alc.cs index 6ff18ea0..a26c4eac 100644 --- a/Source/OpenTK/Audio/OpenAL/Alc/Alc.cs +++ b/Source/OpenTK/Audio/OpenAL/Alc/Alc.cs @@ -94,7 +94,7 @@ namespace OpenTK.Audio /// This function creates a context using a specified device. /// a pointer to a device - /// an array of a set of attributes: ALC_FREQUENCY, ALC_MONO_SOURCES, ALC_REFRESH, ALC_STEREO_SOURCES, ALC_SYNC + /// an array of a set of attributes: ALC_FREQUENCY, ALC_MONO_SOURCES, ALC_REFRESH, ALC_STEREO_SOURCES, ALC_SYNC /// Returns a pointer to the new context (NULL on failure). /// The attribute list can be NULL, or a zero terminated list of integer pairs composed of valid ALC attribute tokens and requested values. public static ContextHandle CreateContext(IntPtr device, int[] attriblist) @@ -267,7 +267,7 @@ namespace OpenTK.Audio /// a pointer to the device to be queried. /// an attribute to be retrieved: ALC_MAJOR_VERSION, ALC_MINOR_VERSION, ALC_ATTRIBUTES_SIZE, ALC_ALL_ATTRIBUTES /// the size of the destination buffer provided. In bytes. - /// a pointer to the buffer to be returned + /// a pointer to the buffer to be returned [DllImport(Alc.Lib, EntryPoint = "alcGetIntegerv", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()] public static extern void GetInteger([In] IntPtr device, AlcGetInteger param, int size, [Out] out int data); // ALC_API void ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *buffer ); diff --git a/Source/OpenTK/Audio/OpenAL/Alut/Alut.cs b/Source/OpenTK/Audio/OpenAL/Alut/Alut.cs index 0bfdba61..a71a6aaa 100644 --- a/Source/OpenTK/Audio/OpenAL/Alut/Alut.cs +++ b/Source/OpenTK/Audio/OpenAL/Alut/Alut.cs @@ -100,7 +100,7 @@ namespace OpenTK.Audio /// Size in Bytes of the sound buffer. /// OpenAL Buffer, 0 on failure. [CLSCompliant(false), DllImport(Alut.Lib, EntryPoint = "alutCreateBufferFromFileImage", ExactSpelling = true, CallingConvention = Alut.Style), SuppressUnmanagedCodeSecurity()] - public static extern uint CreateBufferFromFileImage([In] IntPtr data, int length); + public static extern uint CreateBufferFromFileImage([In] IntPtr buffer, int length); // ALUT_API ALuint ALUT_APIENTRY alutCreateBufferFromFileImage (const ALvoid *buffer, ALsizei length); diff --git a/Source/OpenTK/Audio/SoundData.cs b/Source/OpenTK/Audio/SoundData.cs index 523bfd68..a83bd0e2 100644 --- a/Source/OpenTK/Audio/SoundData.cs +++ b/Source/OpenTK/Audio/SoundData.cs @@ -23,7 +23,8 @@ namespace OpenTK.Audio /// /// Constructs a new SoundData object. - /// An array of PCM buffer. + /// The SoundFormat of these SoundData. + /// An array of PCM buffer. internal SoundData(SoundFormat format, byte[] data) { if (data == null) throw new ArgumentNullException("buffer", "Must be a valid array of samples."); diff --git a/Source/OpenTK/GLControl.cs b/Source/OpenTK/GLControl.cs index cc6467f4..d8f9dce4 100644 --- a/Source/OpenTK/GLControl.cs +++ b/Source/OpenTK/GLControl.cs @@ -55,8 +55,8 @@ namespace OpenTK /// /// The OpenTK.Graphics.GraphicsMode of the control. /// The major version for the OpenGL GraphicsContext. - /// The minor version for the OpenGL GraphicsContext. - /// The GraphicsContextFlags for the OpenGL GraphicsContext. + /// The minor version for the OpenGL GraphicsContext. + /// The GraphicsContextFlags for the OpenGL GraphicsContext. public GLControl(GraphicsMode mode, int major, int minor, GraphicsContextFlags flags) { SetStyle(ControlStyles.Opaque, true); diff --git a/Source/OpenTK/GameWindow.cs b/Source/OpenTK/GameWindow.cs index 061164be..01b3cbf8 100644 --- a/Source/OpenTK/GameWindow.cs +++ b/Source/OpenTK/GameWindow.cs @@ -164,7 +164,7 @@ namespace OpenTK /// GameWindow options regarding window appearance and behavior. /// The OpenTK.Graphics.DisplayDevice to construct the GameWindow in. /// The major version for the OpenGL GraphicsContext. - /// The minor version for the OpenGL GraphicsContext. + /// The minor version for the OpenGL GraphicsContext. /// The GraphicsContextFlags version for the OpenGL GraphicsContext. public GameWindow(int width, int height, GraphicsMode mode, string title, GameWindowFlags options, DisplayDevice device, int major, int minor, GraphicsContextFlags flags) @@ -351,10 +351,10 @@ namespace OpenTK #region public bool Fullscreen - /// - /// TODO: This property is not implemented. - /// Gets or sets a value indicating whether the GameWindow is in fullscrren mode. - /// + ///// + ///// TODO: This property is not implemented. + ///// Gets or sets a value indicating whether the GameWindow is in fullscrren mode. + ///// //public bool Fullscreen //{ // get { if (disposed) throw new ObjectDisposedException("GameWindow"); return glWindow.Fullscreen; } @@ -448,7 +448,7 @@ namespace OpenTK /// /// Enters the game loop of the GameWindow updating and rendering at the maximum possible frequency. /// - /// + /// public void Run() { if (disposed) throw new ObjectDisposedException("GameWindow"); @@ -463,7 +463,7 @@ namespace OpenTK /// Enters the game loop of the GameWindow updating the specified update frequency, while maintaining the /// maximum possible render frequency. /// - /// + /// public void Run(double updateFrequency) { if (disposed) throw new ObjectDisposedException("GameWindow"); @@ -990,6 +990,7 @@ namespace OpenTK /// /// Gets or sets a double representing the target render period, in seconds. /// + /// /// A value of 0.0 indicates that RenderFrame events are generated at the maximum possible frequency (i.e. only limited by the hardware's capabilities). /// Values lower than 0.005 seconds (200Hz) are clamped to 0.0. Values higher than 1.0 seconds (1Hz) are clamped to 1.0. /// diff --git a/Source/OpenTK/Graphics/DisplayDevice.cs b/Source/OpenTK/Graphics/DisplayDevice.cs index a4479b78..2523e574 100644 --- a/Source/OpenTK/Graphics/DisplayDevice.cs +++ b/Source/OpenTK/Graphics/DisplayDevice.cs @@ -308,9 +308,9 @@ namespace OpenTK.Graphics #region public override bool Equals(object obj) - /// Determines whether the specified DisplayDevices are equal. - /// The System.Object to check against. - /// True if the System.Object is an equal DisplayDevice; false otherwise. + ///// Determines whether the specified DisplayDevices are equal. + ///// The System.Object to check against. + ///// True if the System.Object is an equal DisplayDevice; false otherwise. //public override bool Equals(object obj) //{ // if (obj is DisplayDevice) @@ -329,9 +329,9 @@ namespace OpenTK.Graphics #region public override int GetHashCode() - /// Returns a unique hash representing this DisplayDevice. - /// A System.Int32 that may serve as a hash code for this DisplayDevice. - //public override int GetHashCode() + ///// Returns a unique hash representing this DisplayDevice. + ///// A System.Int32 that may serve as a hash code for this DisplayDevice. + ////public override int GetHashCode() //{ // return current_resolution.GetHashCode() ^ IsPrimary.GetHashCode() ^ available_resolutions.Count; //} diff --git a/Source/OpenTK/Graphics/GL/GL.cs b/Source/OpenTK/Graphics/GL/GL.cs index a2734fe6..5f0cfe6a 100644 --- a/Source/OpenTK/Graphics/GL/GL.cs +++ b/Source/OpenTK/Graphics/GL/GL.cs @@ -31,6 +31,8 @@ namespace OpenTK.Graphics using System.Runtime.InteropServices; #pragma warning disable 3019 #pragma warning disable 1591 + #pragma warning disable 1572 + #pragma warning disable 1573 static partial class GL { diff --git a/Source/OpenTK/Graphics/GL/GLHelper.cs b/Source/OpenTK/Graphics/GL/GLHelper.cs index 28e7520f..81a8ed18 100644 --- a/Source/OpenTK/Graphics/GL/GLHelper.cs +++ b/Source/OpenTK/Graphics/GL/GLHelper.cs @@ -144,7 +144,6 @@ namespace OpenTK.Graphics /// base OpenGL name of the function (e.g. "glVertex3fv" instead of "Vertex3"). /// /// The name of the OpenGL function (eg. "glNewList") - /// The signature of the OpenGL function. /// /// A System.Delegate that can be used to call this OpenGL function or null, if the specified /// function name does not correspond to an OpenGL function or if the function is not @@ -212,7 +211,7 @@ namespace OpenTK.Graphics /// /// Tries to reload the given OpenGL function (core or extension). /// - /// The name of the OpenGL function (i.e. glShaderSource) + /// The name of the OpenGL function (i.e. glShaderSource) /// True if the function was found and reloaded, false otherwise. /// /// @@ -339,7 +338,7 @@ namespace OpenTK.Graphics /// /// Checks if a given OpenGL function is supported by the current context. /// - /// The System.Reflection.MethodInfo for the OpenGL function. + /// The System.Reflection.MethodInfo for the OpenGL function. /// True if the function is supported, false otherwise. static bool SupportsFunction(MethodInfo function) { @@ -532,7 +531,7 @@ namespace OpenTK.Graphics /// /// Retrieves the entry point for a dynamically exported OpenGL function. /// - /// The function string for the OpenGL function (eg. "glNewList") + /// The function string for the OpenGL function (eg. "glNewList") /// /// An IntPtr contaning the address for the entry point, or IntPtr.Zero if the specified /// OpenGL function is not dynamically exported. @@ -546,8 +545,6 @@ namespace OpenTK.Graphics /// This function is cross-platform. It determines the underlying platform and uses the /// correct wgl, glx or agl GetAddress function to retrieve the function pointer. /// - /// - /// /// private static IntPtr GetAddress(string function) { diff --git a/Source/OpenTK/Graphics/Glu/GluHelper.cs b/Source/OpenTK/Graphics/Glu/GluHelper.cs index a9ba6a08..2644a315 100644 --- a/Source/OpenTK/Graphics/Glu/GluHelper.cs +++ b/Source/OpenTK/Graphics/Glu/GluHelper.cs @@ -81,7 +81,7 @@ namespace OpenTK.Graphics /// /// Tries to reload the given GLU function (core or extension). /// - /// The name of the GLU function. + /// The name of the GLU function. /// True if the function was found and reloaded, false otherwise. /// /// diff --git a/Source/OpenTK/Graphics/GraphicsContext.cs b/Source/OpenTK/Graphics/GraphicsContext.cs index ebd87945..2e642eac 100644 --- a/Source/OpenTK/Graphics/GraphicsContext.cs +++ b/Source/OpenTK/Graphics/GraphicsContext.cs @@ -46,7 +46,7 @@ namespace OpenTK.Graphics /// /// Constructs a new GraphicsContext with the specified GraphicsMode and attaches it to the specified window. /// - /// The OpenTK.Graphics.GraphicsMode of the GraphicsContext. + /// The OpenTK.Graphics.GraphicsMode of the GraphicsContext. /// The OpenTK.Platform.IWindowInfo to attach the GraphicsContext to. public GraphicsContext(GraphicsMode mode, IWindowInfo window) : this(mode, window, 1, 0, GraphicsContextFlags.Default) @@ -55,7 +55,7 @@ namespace OpenTK.Graphics /// /// Constructs a new GraphicsContext with the specified GraphicsMode, version and flags, and attaches it to the specified window. /// - /// The OpenTK.Graphics.GraphicsMode of the GraphicsContext. + /// The OpenTK.Graphics.GraphicsMode of the GraphicsContext. /// The OpenTK.Platform.IWindowInfo to attach the GraphicsContext to. /// The major version of the new GraphicsContext. /// The minor version of the new GraphicsContext. @@ -457,7 +457,6 @@ namespace OpenTK.Graphics /// A pointer to the specified function or IntPtr.Zero if the function isn't /// available in the current opengl context. /// - /// IntPtr IGraphicsContextInternal.GetAddress(string function) { return (implementation as IGraphicsContextInternal).GetAddress(function); diff --git a/Source/OpenTK/Input/JoystickDevice.cs b/Source/OpenTK/Input/JoystickDevice.cs index 273dc2de..6f99cdac 100644 --- a/Source/OpenTK/Input/JoystickDevice.cs +++ b/Source/OpenTK/Input/JoystickDevice.cs @@ -237,7 +237,7 @@ namespace OpenTK.Input /// /// Initializes a new instance of the class. /// - /// The index of the joystick axis that was moved. + /// The index of the joystick axis that was moved. /// The absolute value of the joystick axis. /// The relative change in value of the joystick axis. public JoystickMoveEventArgs(JoystickAxis axis, float value, float delta) @@ -355,7 +355,7 @@ namespace OpenTK.Input /// /// Gets a System.Boolean indicating whether the specified JoystickButton is pressed. /// - /// The JoystickButton to check. + /// The JoystickButton to check. /// True if the JoystickButton is pressed; false otherwise. public bool this[JoystickButton button] { @@ -448,7 +448,7 @@ namespace OpenTK.Input /// /// Gets a System.Single indicating the absolute position of the JoystickAxis. /// - /// The JoystickAxis to check. + /// The JoystickAxis to check. /// A System.Single in the range [-1, 1]. public float this[JoystickAxis axis] { diff --git a/Source/OpenTK/Input/MouseDevice.cs b/Source/OpenTK/Input/MouseDevice.cs index f9712f28..2033fc61 100644 --- a/Source/OpenTK/Input/MouseDevice.cs +++ b/Source/OpenTK/Input/MouseDevice.cs @@ -160,7 +160,7 @@ namespace OpenTK.Input /// /// Gets a System.Boolean indicating the state of the specified MouseButton. /// - /// The MouseButton to check. + /// The MouseButton to check. /// True if the MouseButton is pressed, false otherwise. public bool this[MouseButton button] { diff --git a/Source/OpenTK/Math/Functions.cs b/Source/OpenTK/Math/Functions.cs index ccc8d105..c4eac2ac 100644 --- a/Source/OpenTK/Math/Functions.cs +++ b/Source/OpenTK/Math/Functions.cs @@ -130,7 +130,7 @@ namespace OpenTK.Math /// /// Convert radians to degrees /// - /// An angle in radians + /// An angle in radians /// The angle expressed in degrees public static float RadiansToDegrees(float radians) { diff --git a/Source/OpenTK/Math/Matrix4.cs b/Source/OpenTK/Math/Matrix4.cs index c3a67690..21321a62 100644 --- a/Source/OpenTK/Math/Matrix4.cs +++ b/Source/OpenTK/Math/Matrix4.cs @@ -391,8 +391,9 @@ namespace OpenTK.Math /// /// Post multiply this matrix by another matrix /// - /// The matrix to multiply - /// A new Matrix44 that is the result of the multiplication + /// The left operand of the multiplication. + /// The right operand of the multiplication. + /// A new instance that is the result of the multiplication public static Matrix4 Mult(Matrix4 left, Matrix4 right) { Vector4 col0 = right.Column0; @@ -553,6 +554,7 @@ namespace OpenTK.Math /// Calculate the transpose of the given matrix /// /// The matrix to transpose + /// The result of the calculation public static void Transpose(ref Matrix4 mat, out Matrix4 result) { result.Row0 = mat.Column0; @@ -642,7 +644,7 @@ namespace OpenTK.Math #region IEquatable Members /// Indicates whether the current matrix is equal to another matrix. - /// An matrix to compare with this matrix. + /// An matrix to compare with this matrix. /// true if the current matrix is equal to the matrix parameter; otherwise, false. public bool Equals(Matrix4 other) { diff --git a/Source/OpenTK/Math/Matrix4d.cs b/Source/OpenTK/Math/Matrix4d.cs index 3a6f49b7..d650301f 100644 --- a/Source/OpenTK/Math/Matrix4d.cs +++ b/Source/OpenTK/Math/Matrix4d.cs @@ -423,8 +423,9 @@ namespace OpenTK.Math /// /// Post multiply this matrix by another matrix /// - /// The matrix to multiply - /// A new Matrix44 that is the result of the multiplication + /// The left operand of the multiplication. + /// The right operand of the multiplication. + /// A new instance that is the result of the multiplication public static Matrix4d Mult(Matrix4d left, Matrix4d right) { Vector4d col0 = right.Column0; @@ -585,6 +586,7 @@ namespace OpenTK.Math /// Calculate the transpose of the given matrix /// /// The matrix to transpose + /// The result of the calculation public static void Transpose(ref Matrix4d mat, out Matrix4d result) { result.Row0 = mat.Column0; @@ -674,7 +676,7 @@ namespace OpenTK.Math #region IEquatable Members /// Indicates whether the current matrix is equal to another matrix. - /// An matrix to compare with this matrix. + /// An matrix to compare with this matrix. /// true if the current matrix is equal to the matrix parameter; otherwise, false. public bool Equals(Matrix4d other) { diff --git a/Source/OpenTK/Math/Quaternion.cs b/Source/OpenTK/Math/Quaternion.cs index 306515d0..51305163 100644 --- a/Source/OpenTK/Math/Quaternion.cs +++ b/Source/OpenTK/Math/Quaternion.cs @@ -532,10 +532,10 @@ namespace OpenTK.Math /// /// The other object to be used in the comparison. /// True if both objects are Quaternions of equal value. Otherwise it returns false. - public override bool Equals(object o) + public override bool Equals(object other) { - if (o is Quaternion == false) return false; - return this == (Quaternion)o; + if (other is Quaternion == false) return false; + return this == (Quaternion)other; } #endregion diff --git a/Source/OpenTK/Math/Quaterniond.cs b/Source/OpenTK/Math/Quaterniond.cs index 2bea3401..f045da7a 100644 --- a/Source/OpenTK/Math/Quaterniond.cs +++ b/Source/OpenTK/Math/Quaterniond.cs @@ -532,10 +532,10 @@ namespace OpenTK.Math /// /// The other object to be used in the comparison. /// True if both objects are Quaternions of equal value. Otherwise it returns false. - public override bool Equals(object o) + public override bool Equals(object other) { - if (o is Quaterniond == false) return false; - return this == (Quaterniond)o; + if (other is Quaterniond == false) return false; + return this == (Quaterniond)other; } #endregion diff --git a/Source/OpenTK/Math/Vector2.cs b/Source/OpenTK/Math/Vector2.cs index 94db4050..9921e1b1 100644 --- a/Source/OpenTK/Math/Vector2.cs +++ b/Source/OpenTK/Math/Vector2.cs @@ -173,7 +173,7 @@ namespace OpenTK.Math /// /// Gets the length (magnitude) of the vector. /// - /// + /// /// public float Length { @@ -196,7 +196,6 @@ namespace OpenTK.Math /// /// /// - /// public float LengthFast { get @@ -217,7 +216,7 @@ namespace OpenTK.Math /// for comparisons. /// /// - /// + /// public float LengthSquared { get @@ -849,7 +848,7 @@ namespace OpenTK.Math #region IEquatable Members /// Indicates whether the current vector is equal to another vector. - /// A vector to compare with this vector. + /// A vector to compare with this vector. /// true if the current vector is equal to the vector parameter; otherwise, false. public bool Equals(Vector2 other) { diff --git a/Source/OpenTK/Math/Vector2d.cs b/Source/OpenTK/Math/Vector2d.cs index b5ffdee9..84512447 100644 --- a/Source/OpenTK/Math/Vector2d.cs +++ b/Source/OpenTK/Math/Vector2d.cs @@ -172,7 +172,6 @@ namespace OpenTK.Math /// for comparisons. /// /// - /// public double LengthSquared { get @@ -327,7 +326,7 @@ namespace OpenTK.Math /// Multiply a vector and a scalar /// /// Vector operand - /// Scalar operand + /// Scalar operand /// Result of the multiplication public static Vector2d Mult(Vector2d a, double d) { @@ -340,7 +339,7 @@ namespace OpenTK.Math /// Multiply a vector and a scalar /// /// Vector operand - /// Scalar operand + /// Scalar operand /// Result of the multiplication public static void Mult(ref Vector2d a, double d, out Vector2d result) { @@ -356,7 +355,7 @@ namespace OpenTK.Math /// Divide a vector by a scalar /// /// Vector operand - /// Scalar operand + /// Scalar operand /// Result of the division public static Vector2d Div(Vector2d a, double d) { @@ -370,7 +369,7 @@ namespace OpenTK.Math /// Divide a vector by a scalar /// /// Vector operand - /// Scalar operand + /// Scalar operand /// Result of the division public static void Div(ref Vector2d a, double d, out Vector2d result) { @@ -752,7 +751,7 @@ namespace OpenTK.Math #region IEquatable Members /// Indicates whether the current vector is equal to another vector. - /// A vector to compare with this vector. + /// A vector to compare with this vector. /// true if the current vector is equal to the vector parameter; otherwise, false. public bool Equals(Vector2d other) { diff --git a/Source/OpenTK/Math/Vector2h.cs b/Source/OpenTK/Math/Vector2h.cs index 7995c884..df720fa7 100644 --- a/Source/OpenTK/Math/Vector2h.cs +++ b/Source/OpenTK/Math/Vector2h.cs @@ -186,7 +186,6 @@ namespace OpenTK.Math /// /// Returns this Half2 instance's contents as Vector2d. /// - /// OpenTK.Math.Vector2d public Vector2d ToVector2d() { return new Vector2d(X, Y); @@ -197,7 +196,7 @@ namespace OpenTK.Math #region Conversions /// Converts OpenTK.Math.Vector2 to OpenTK.Math.Half2. - /// The Vector2 to convert. + /// The Vector2 to convert. /// The resulting Half vector. public static explicit operator Vector2h(Vector2 v) { @@ -205,7 +204,7 @@ namespace OpenTK.Math } /// Converts OpenTK.Math.Vector2d to OpenTK.Math.Half2. - /// The Vector2d to convert. + /// The Vector2d to convert. /// The resulting Half vector. public static explicit operator Vector2h(Vector2d v) { @@ -213,7 +212,7 @@ namespace OpenTK.Math } /// Converts OpenTK.Math.Half2 to OpenTK.Math.Vector2. - /// The Half2 to convert. + /// The Half2 to convert. /// The resulting Vector2. public static explicit operator Vector2(Vector2h h) { @@ -221,7 +220,7 @@ namespace OpenTK.Math } /// Converts OpenTK.Math.Half2 to OpenTK.Math.Vector2d. - /// The Half2 to convert. + /// The Half2 to convert. /// The resulting Vector2d. public static explicit operator Vector2d(Vector2h h) { diff --git a/Source/OpenTK/Math/Vector3.cs b/Source/OpenTK/Math/Vector3.cs index 55b8e2e1..5f888e5e 100644 --- a/Source/OpenTK/Math/Vector3.cs +++ b/Source/OpenTK/Math/Vector3.cs @@ -28,49 +28,49 @@ using System.Xml.Serialization; namespace OpenTK.Math { - /// + /// /// Represents a 3D vector using three single-precision floating-point numbers. /// /// /// The Vector3 structure is suitable for interoperation with unmanaged code requiring three consecutive floats. /// [Serializable] - [StructLayout(LayoutKind.Sequential)] - public struct Vector3 : IEquatable - { - #region Fields + [StructLayout(LayoutKind.Sequential)] + public struct Vector3 : IEquatable + { + #region Fields - /// - /// The X component of the Vector3. - /// - public float X; + /// + /// The X component of the Vector3. + /// + public float X; - /// - /// The Y component of the Vector3. - /// - public float Y; + /// + /// The Y component of the Vector3. + /// + public float Y; - /// - /// The Z component of the Vector3. - /// - public float Z; + /// + /// The Z component of the Vector3. + /// + public float Z; #endregion - #region Constructors + #region Constructors - /// - /// Constructs a new Vector3. - /// - /// The x component of the Vector3. - /// The y component of the Vector3. - /// The z component of the Vector3. - public Vector3(float x, float y, float z) - { - X = x; - Y = y; - Z = z; - } + /// + /// Constructs a new Vector3. + /// + /// The x component of the Vector3. + /// The y component of the Vector3. + /// The z component of the Vector3. + public Vector3(float x, float y, float z) + { + X = x; + Y = y; + Z = z; + } /// /// Constructs a new Vector3 from the given Vector2. @@ -110,12 +110,12 @@ namespace OpenTK.Math #region Public Members #region Instance - + #region public void Add() /// Add the Vector passed as parameter to this instance. /// Right operand. This parameter is only read from. - public void Add( Vector3 right ) + public void Add(Vector3 right) { this.X += right.X; this.Y += right.Y; @@ -125,7 +125,7 @@ namespace OpenTK.Math /// Add the Vector passed as parameter to this instance. /// Right operand. This parameter is only read from. [CLSCompliant(false)] - public void Add( ref Vector3 right ) + public void Add(ref Vector3 right) { this.X += right.X; this.Y += right.Y; @@ -138,7 +138,7 @@ namespace OpenTK.Math /// Subtract the Vector passed as parameter from this instance. /// Right operand. This parameter is only read from. - public void Sub( Vector3 right ) + public void Sub(Vector3 right) { this.X -= right.X; this.Y -= right.Y; @@ -148,7 +148,7 @@ namespace OpenTK.Math /// Subtract the Vector passed as parameter from this instance. /// Right operand. This parameter is only read from. [CLSCompliant(false)] - public void Sub( ref Vector3 right ) + public void Sub(ref Vector3 right) { this.X -= right.X; this.Y -= right.Y; @@ -161,7 +161,7 @@ namespace OpenTK.Math /// Multiply this instance by a scalar. /// Scalar operand. - public void Mult( float f ) + public void Mult(float f) { this.X *= f; this.Y *= f; @@ -174,7 +174,7 @@ namespace OpenTK.Math /// Divide this instance by a scalar. /// Scalar operand. - public void Div( float f ) + public void Div(float f) { float mult = 1.0f / f; this.X *= mult; @@ -189,7 +189,7 @@ namespace OpenTK.Math /// /// Gets the length (magnitude) of the vector. /// - /// + /// /// public float Length { @@ -212,7 +212,6 @@ namespace OpenTK.Math /// /// /// - /// public float LengthFast { get @@ -233,7 +232,7 @@ namespace OpenTK.Math /// for comparisons. /// /// - /// + /// public float LengthSquared { get @@ -291,7 +290,7 @@ namespace OpenTK.Math /// Scales this instance by the given parameter. /// The scaling of the individual components. - public void Scale( Vector3 scale ) + public void Scale(Vector3 scale) { this.X *= scale.X; this.Y *= scale.Y; @@ -301,7 +300,7 @@ namespace OpenTK.Math /// Scales this instance by the given parameter. /// The scaling of the individual components. [CLSCompliant(false)] - public void Scale( ref Vector3 scale ) + public void Scale(ref Vector3 scale) { this.X *= scale.X; this.Y *= scale.Y; @@ -675,7 +674,7 @@ namespace OpenTK.Math /// First operand /// Second operand /// The dot product of the two inputs - public static void Dot( ref Vector3 left, ref Vector3 right, out float result ) + public static void Dot(ref Vector3 left, ref Vector3 right, out float result) { result = left.X * right.X + left.Y * right.Y + left.Z * right.Z; } @@ -737,11 +736,11 @@ namespace OpenTK.Math /// Second input vector /// The blend factor. a when blend=0, b when blend=1. /// a when blend=0, b when blend=1, and a linear combination otherwise - public static void Lerp( ref Vector3 a, ref Vector3 b, float blend, out Vector3 result ) + public static void Lerp(ref Vector3 a, ref Vector3 b, float blend, out Vector3 result) { - result.X = blend * ( b.X - a.X ) + a.X; - result.Y = blend * ( b.Y - a.Y ) + a.Y; - result.Z = blend * ( b.Z - a.Z ) + a.Z; + result.X = blend * (b.X - a.X) + a.X; + result.Y = blend * (b.Y - a.Y) + a.Y; + result.Z = blend * (b.Z - a.Z) + a.Z; } #endregion @@ -769,19 +768,19 @@ namespace OpenTK.Math /// First Barycentric Coordinate. /// Second Barycentric Coordinate. /// Output Vector. a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise - public static void BaryCentric( ref Vector3 a, ref Vector3 b, ref Vector3 c, float u, float v, out Vector3 result ) + public static void BaryCentric(ref Vector3 a, ref Vector3 b, ref Vector3 c, float u, float v, out Vector3 result) { result = a; // copy Vector3 temp = b; // copy - temp.Sub( ref a ); - temp.Mult( u ); - result.Add( ref temp ); + temp.Sub(ref a); + temp.Mult(u); + result.Add(ref temp); temp = c; // copy - temp.Sub( ref a ); - temp.Mult( v ); - result.Add( ref temp ); + temp.Sub(ref a); + temp.Mult(v); + result.Add(ref temp); } #endregion @@ -809,7 +808,7 @@ namespace OpenTK.Math /// The vector to transform /// The desired transformation /// The transformed vector - public static void TransformVector( ref Vector3 vec, ref Matrix4 mat, out Vector3 result) + public static void TransformVector(ref Vector3 vec, ref Matrix4 mat, out Vector3 result) { result.X = vec.X * mat.Row0.X + vec.Y * mat.Row1.X + @@ -846,10 +845,10 @@ namespace OpenTK.Math /// The normal to transform /// The desired transformation /// The transformed normal - public static void TransformNormal( ref Vector3 norm, ref Matrix4 mat, out Vector3 result) + public static void TransformNormal(ref Vector3 norm, ref Matrix4 mat, out Vector3 result) { - Matrix4 Inverse = Matrix4.Invert( mat ); - Vector3.TransformNormalInverse( ref norm, ref Inverse, out result ); + Matrix4 Inverse = Matrix4.Invert(mat); + Vector3.TransformNormalInverse(ref norm, ref Inverse, out result); } /// Transform a Normal by the (transpose of the) given Matrix @@ -858,7 +857,7 @@ namespace OpenTK.Math /// Use this version if you already have the inverse of the desired transform to hand /// /// The normal to transform - /// The inverse of the desired transformation + /// The inverse of the desired transformation /// The transformed normal public static Vector3 TransformNormalInverse(Vector3 norm, Matrix4 invMat) { @@ -875,9 +874,9 @@ namespace OpenTK.Math /// Use this version if you already have the inverse of the desired transform to hand /// /// The normal to transform - /// The inverse of the desired transformation + /// The inverse of the desired transformation /// The transformed normal - public static void TransformNormalInverse( ref Vector3 norm, ref Matrix4 invMat, out Vector3 result ) + public static void TransformNormalInverse(ref Vector3 norm, ref Matrix4 invMat, out Vector3 result) { result.X = norm.X * invMat.Row0.X + norm.Y * invMat.Row0.Y + @@ -909,7 +908,7 @@ namespace OpenTK.Math /// The position to transform /// The desired transformation /// The transformed position - public static void TransformPosition( ref Vector3 pos, ref Matrix4 mat, out Vector3 result ) + public static void TransformPosition(ref Vector3 pos, ref Matrix4 mat, out Vector3 result) { result.X = pos.X * mat.Row0.X + pos.Y * mat.Row1.X + @@ -928,7 +927,7 @@ namespace OpenTK.Math } /// Transform a Vector by the given Matrix - /// The vector to transform + /// The vector to transform /// The desired transformation /// The transformed vector public static Vector4 Transform(Vector3 vec, Matrix4 mat) @@ -943,17 +942,17 @@ namespace OpenTK.Math } /// Transform a Vector by the given Matrix - /// The vector to transform + /// The vector to transform /// The desired transformation /// The transformed vector - public static void Transform( ref Vector3 vec, ref Matrix4 mat, out Vector4 result ) + public static void Transform(ref Vector3 vec, ref Matrix4 mat, out Vector4 result) { - Vector4 v4 = new Vector4( vec.X, vec.Y, vec.Z, 1.0f ); - Vector4.Transform( ref v4, ref mat, out result ); + Vector4 v4 = new Vector4(vec.X, vec.Y, vec.Z, 1.0f); + Vector4.Transform(ref v4, ref mat, out result); } /// Transform a Vector3 by the given Matrix, and project the resulting Vector4 back to a Vector3 - /// The vector to transform + /// The vector to transform /// The desired transformation /// The transformed vector public static Vector3 TransformPerspective(Vector3 vec, Matrix4 mat) @@ -963,13 +962,13 @@ namespace OpenTK.Math } /// Transform a Vector3 by the given Matrix, and project the resulting Vector4 back to a Vector3 - /// The vector to transform + /// The vector to transform /// The desired transformation /// The transformed vector - public static void TransformPerspective( ref Vector3 vec, ref Matrix4 mat, out Vector3 result ) + public static void TransformPerspective(ref Vector3 vec, ref Matrix4 mat, out Vector3 result) { Vector4 h; - Vector3.Transform( ref vec, ref mat, out h ); + Vector3.Transform(ref vec, ref mat, out h); result.X = h.X / h.W; result.Y = h.Y / h.W; result.Z = h.Z / h.W; @@ -996,11 +995,11 @@ namespace OpenTK.Math /// The second vector. /// Angle (in radians) between the vectors. /// Note that the returned angle is never bigger than the constant Pi. - public static void CalculateAngle( ref Vector3 first, ref Vector3 second, out float result ) + public static void CalculateAngle(ref Vector3 first, ref Vector3 second, out float result) { float temp; - Vector3.Dot( ref first, ref second, out temp ); - result = (float)System.Math.Acos( temp / ( first.Length * second.Length ) ); + Vector3.Dot(ref first, ref second, out temp); + result = (float)System.Math.Acos(temp / (first.Length * second.Length)); } #endregion @@ -1021,52 +1020,52 @@ namespace OpenTK.Math public static Vector3 operator +(Vector3 left, Vector3 right) { - left.X += right.X; - left.Y += right.Y; - left.Z += right.Z; - return left; + left.X += right.X; + left.Y += right.Y; + left.Z += right.Z; + return left; } public static Vector3 operator -(Vector3 left, Vector3 right) { - left.X -= right.X; - left.Y -= right.Y; - left.Z -= right.Z; - return left; + left.X -= right.X; + left.Y -= right.Y; + left.Z -= right.Z; + return left; } - public static Vector3 operator -(Vector3 vec) - { - vec.X = -vec.X; - vec.Y = -vec.Y; - vec.Z = -vec.Z; - return vec; - } + public static Vector3 operator -(Vector3 vec) + { + vec.X = -vec.X; + vec.Y = -vec.Y; + vec.Z = -vec.Z; + return vec; + } - public static Vector3 operator *(Vector3 vec, float f) - { - vec.X *= f; - vec.Y *= f; - vec.Z *= f; - return vec; - } + public static Vector3 operator *(Vector3 vec, float f) + { + vec.X *= f; + vec.Y *= f; + vec.Z *= f; + return vec; + } - public static Vector3 operator *(float f, Vector3 vec) - { - vec.X *= f; - vec.Y *= f; - vec.Z *= f; - return vec; - } + public static Vector3 operator *(float f, Vector3 vec) + { + vec.X *= f; + vec.Y *= f; + vec.Z *= f; + return vec; + } - public static Vector3 operator /(Vector3 vec, float f) - { - float mult = 1.0f / f; - vec.X *= mult; - vec.Y *= mult; - vec.Z *= mult; - return vec; - } + public static Vector3 operator /(Vector3 vec, float f) + { + float mult = 1.0f / f; + vec.X *= mult; + vec.Y *= mult; + vec.Z *= mult; + return vec; + } public static bool operator ==(Vector3 left, Vector3 right) { @@ -1085,15 +1084,15 @@ namespace OpenTK.Math #region public override string ToString() /// - /// Returns a System.String that represents the current Vector3. - /// - /// - public override string ToString() + /// Returns a System.String that represents the current Vector3. + /// + /// + public override string ToString() { return String.Format("({0}, {1}, {2})", X, Y, Z); - } + } - #endregion + #endregion #region public override int GetHashCode() @@ -1132,7 +1131,7 @@ namespace OpenTK.Math #region IEquatable Members /// Indicates whether the current vector is equal to another vector. - /// A vector to compare with this vector. + /// A vector to compare with this vector. /// true if the current vector is equal to the vector parameter; otherwise, false. public bool Equals(Vector3 other) { diff --git a/Source/OpenTK/Math/Vector3d.cs b/Source/OpenTK/Math/Vector3d.cs index 72eefb17..3d8c48ed 100644 --- a/Source/OpenTK/Math/Vector3d.cs +++ b/Source/OpenTK/Math/Vector3d.cs @@ -37,39 +37,39 @@ namespace OpenTK.Math { #region Fields - /// - /// The X component of the Vector3. - /// - public double X; + /// + /// The X component of the Vector3. + /// + public double X; - /// - /// The Y component of the Vector3. - /// - public double Y; + /// + /// The Y component of the Vector3. + /// + public double Y; - /// - /// The Z component of the Vector3. - /// - public double Z; + /// + /// The Z component of the Vector3. + /// + public double Z; #endregion - #region Constructors + #region Constructors - /// - /// Constructs a new Vector3. - /// - /// The x component of the Vector3. - /// The y component of the Vector3. - /// The z component of the Vector3. - public Vector3d(double x, double y, double z) - { - X = x; - Y = y; - Z = z; - } + /// + /// Constructs a new Vector3. + /// + /// The x component of the Vector3. + /// The y component of the Vector3. + /// The z component of the Vector3. + public Vector3d(double x, double y, double z) + { + X = x; + Y = y; + Z = z; + } - /// + /// /// Constructs a new instance from the given Vector2d. /// /// The Vector2d to copy components from. @@ -113,7 +113,7 @@ namespace OpenTK.Math /// Add the Vector passed as parameter to this instance. /// Right operand. This parameter is only read from. - public void Add( Vector3d right ) + public void Add(Vector3d right) { this.X += right.X; this.Y += right.Y; @@ -123,7 +123,7 @@ namespace OpenTK.Math /// Add the Vector passed as parameter to this instance. /// Right operand. This parameter is only read from. [CLSCompliant(false)] - public void Add( ref Vector3d right ) + public void Add(ref Vector3d right) { this.X += right.X; this.Y += right.Y; @@ -136,7 +136,7 @@ namespace OpenTK.Math /// Subtract the Vector passed as parameter from this instance. /// Right operand. This parameter is only read from. - public void Sub( Vector3d right ) + public void Sub(Vector3d right) { this.X -= right.X; this.Y -= right.Y; @@ -146,7 +146,7 @@ namespace OpenTK.Math /// Subtract the Vector passed as parameter from this instance. /// Right operand. This parameter is only read from. [CLSCompliant(false)] - public void Sub( ref Vector3d right ) + public void Sub(ref Vector3d right) { this.X -= right.X; this.Y -= right.Y; @@ -159,7 +159,7 @@ namespace OpenTK.Math /// Multiply this instance by a scalar. /// Scalar operand. - public void Mult( double f ) + public void Mult(double f) { this.X *= f; this.Y *= f; @@ -172,7 +172,7 @@ namespace OpenTK.Math /// Divide this instance by a scalar. /// Scalar operand. - public void Div( double f ) + public void Div(double f) { double mult = 1.0 / f; this.X *= mult; @@ -187,7 +187,7 @@ namespace OpenTK.Math /// /// Gets the length (magnitude) of the vector. /// - /// + /// /// public double Length { @@ -210,7 +210,6 @@ namespace OpenTK.Math /// /// /// - /// public double LengthFast { get @@ -231,7 +230,7 @@ namespace OpenTK.Math /// for comparisons. /// /// - /// + /// public double LengthSquared { get @@ -289,7 +288,7 @@ namespace OpenTK.Math /// Scales this instance by the given parameter. /// The scaling of the individual components. - public void Scale( Vector3d scale ) + public void Scale(Vector3d scale) { this.X *= scale.X; this.Y *= scale.Y; @@ -299,7 +298,7 @@ namespace OpenTK.Math /// Scales this instance by the given parameter. /// The scaling of the individual components. [CLSCompliant(false)] - public void Scale( ref Vector3d scale ) + public void Scale(ref Vector3d scale) { this.X *= scale.X; this.Y *= scale.Y; @@ -673,7 +672,7 @@ namespace OpenTK.Math /// First operand /// Second operand /// The dot product of the two inputs - public static void Dot( ref Vector3d left, ref Vector3d right, out double result ) + public static void Dot(ref Vector3d left, ref Vector3d right, out double result) { result = left.X * right.X + left.Y * right.Y + left.Z * right.Z; } @@ -735,11 +734,11 @@ namespace OpenTK.Math /// Second input vector /// The blend factor. a when blend=0, b when blend=1. /// a when blend=0, b when blend=1, and a linear combination otherwise - public static void Lerp( ref Vector3d a, ref Vector3d b, double blend, out Vector3d result ) + public static void Lerp(ref Vector3d a, ref Vector3d b, double blend, out Vector3d result) { - result.X = blend * ( b.X - a.X ) + a.X; - result.Y = blend * ( b.Y - a.Y ) + a.Y; - result.Z = blend * ( b.Z - a.Z ) + a.Z; + result.X = blend * (b.X - a.X) + a.X; + result.Y = blend * (b.Y - a.Y) + a.Y; + result.Z = blend * (b.Z - a.Z) + a.Z; } #endregion @@ -767,19 +766,19 @@ namespace OpenTK.Math /// First Barycentric Coordinate. /// Second Barycentric Coordinate. /// Output Vector. a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise - public static void BaryCentric( ref Vector3d a, ref Vector3d b, ref Vector3d c, float u, float v, out Vector3d result ) + public static void BaryCentric(ref Vector3d a, ref Vector3d b, ref Vector3d c, float u, float v, out Vector3d result) { result = a; // copy Vector3d temp = b; // copy - temp.Sub( ref a ); - temp.Mult( u ); - result.Add( ref temp ); + temp.Sub(ref a); + temp.Mult(u); + result.Add(ref temp); temp = c; // copy - temp.Sub( ref a ); - temp.Mult( v ); - result.Add( ref temp ); + temp.Sub(ref a); + temp.Mult(v); + result.Add(ref temp); } #endregion @@ -806,7 +805,7 @@ namespace OpenTK.Math /// The vector to transform /// The desired transformation /// The transformed vector - public static void TransformVector( ref Vector3d vec, ref Matrix4d mat, out Vector3d result ) + public static void TransformVector(ref Vector3d vec, ref Matrix4d mat, out Vector3d result) { result.X = vec.X * mat.Row0.X + vec.Y * mat.Row1.X + @@ -843,10 +842,10 @@ namespace OpenTK.Math /// The normal to transform /// The desired transformation /// The transformed normal - public static void TransformNormal( ref Vector3d norm, ref Matrix4d mat, out Vector3d result ) + public static void TransformNormal(ref Vector3d norm, ref Matrix4d mat, out Vector3d result) { - Matrix4d Inverse = Matrix4d.Invert( mat ); - Vector3d.TransformNormalInverse( ref norm, ref Inverse, out result ); + Matrix4d Inverse = Matrix4d.Invert(mat); + Vector3d.TransformNormalInverse(ref norm, ref Inverse, out result); } /// Transform a Normal by the (transpose of the) given Matrix @@ -855,7 +854,7 @@ namespace OpenTK.Math /// Use this version if you already have the inverse of the desired transform to hand /// /// The normal to transform - /// The inverse of the desired transformation + /// The inverse of the desired transformation /// The transformed normal public static Vector3d TransformNormalInverse(Vector3d norm, Matrix4d invMat) { @@ -871,9 +870,9 @@ namespace OpenTK.Math /// Use this version if you already have the inverse of the desired transform to hand /// /// The normal to transform - /// The inverse of the desired transformation + /// The inverse of the desired transformation /// The transformed normal - public static void TransformNormalInverse( ref Vector3d norm, ref Matrix4d invMat, out Vector3d result ) + public static void TransformNormalInverse(ref Vector3d norm, ref Matrix4d invMat, out Vector3d result) { result.X = norm.X * invMat.Row0.X + norm.Y * invMat.Row0.Y + @@ -904,7 +903,7 @@ namespace OpenTK.Math /// The position to transform /// The desired transformation /// The transformed position - public static void TransformPosition( ref Vector3d pos, ref Matrix4d mat, out Vector3d result ) + public static void TransformPosition(ref Vector3d pos, ref Matrix4d mat, out Vector3d result) { result.X = pos.X * mat.Row0.X + pos.Y * mat.Row1.X + @@ -923,7 +922,7 @@ namespace OpenTK.Math } /// Transform a Vector by the given Matrix - /// The vector to transform + /// The vector to transform /// The desired transformation /// The transformed vector public static Vector4d Transform(Vector3d vec, Matrix4d mat) @@ -937,19 +936,19 @@ namespace OpenTK.Math } /// Transform a Vector by the given Matrix - /// The vector to transform + /// The vector to transform /// The desired transformation /// The transformed vector - public static void Transform( ref Vector3d vec, ref Matrix4d mat, out Vector4d result ) + public static void Transform(ref Vector3d vec, ref Matrix4d mat, out Vector4d result) { - Vector4d v4 = new Vector4d( vec.X, vec.Y, vec.Z, 1.0f ); - Vector4d.Transform( ref v4, ref mat, out result ); + Vector4d v4 = new Vector4d(vec.X, vec.Y, vec.Z, 1.0f); + Vector4d.Transform(ref v4, ref mat, out result); } /// /// Transform a Vector3d by the given Matrix, and project the resulting Vector4 back to a Vector3 /// - /// The vector to transform + /// The vector to transform /// The desired transformation /// The transformed vector public static Vector3d TransformPerspective(Vector3d vec, Matrix4d mat) @@ -959,13 +958,13 @@ namespace OpenTK.Math } /// Transform a Vector3d by the given Matrix, and project the resulting Vector4d back to a Vector3d - /// The vector to transform + /// The vector to transform /// The desired transformation /// The transformed vector - public static void TransformPerspective( ref Vector3d vec, ref Matrix4d mat, out Vector3d result ) + public static void TransformPerspective(ref Vector3d vec, ref Matrix4d mat, out Vector3d result) { Vector4d h; - Vector3d.Transform( ref vec, ref mat, out h ); + Vector3d.Transform(ref vec, ref mat, out h); result.X = h.X / h.W; result.Y = h.Y / h.W; result.Z = h.Z / h.W; @@ -992,11 +991,11 @@ namespace OpenTK.Math /// The second vector. /// Angle (in radians) between the vectors. /// Note that the returned angle is never bigger than the constant Pi. - public static void CalculateAngle( ref Vector3d first, ref Vector3d second, out double result ) + public static void CalculateAngle(ref Vector3d first, ref Vector3d second, out double result) { double temp; - Vector3d.Dot( ref first, ref second, out temp ); - result = System.Math.Acos( temp / ( first.Length * second.Length ) ); + Vector3d.Dot(ref first, ref second, out temp); + result = System.Math.Acos(temp / (first.Length * second.Length)); } #endregion @@ -1017,52 +1016,52 @@ namespace OpenTK.Math public static Vector3d operator +(Vector3d left, Vector3d right) { - left.X += right.X; - left.Y += right.Y; - left.Z += right.Z; - return left; + left.X += right.X; + left.Y += right.Y; + left.Z += right.Z; + return left; } public static Vector3d operator -(Vector3d left, Vector3d right) { - left.X -= right.X; - left.Y -= right.Y; - left.Z -= right.Z; - return left; + left.X -= right.X; + left.Y -= right.Y; + left.Z -= right.Z; + return left; } - public static Vector3d operator -(Vector3d vec) - { - vec.X = -vec.X; - vec.Y = -vec.Y; - vec.Z = -vec.Z; - return vec; - } + public static Vector3d operator -(Vector3d vec) + { + vec.X = -vec.X; + vec.Y = -vec.Y; + vec.Z = -vec.Z; + return vec; + } - public static Vector3d operator *(Vector3d vec, double f) - { - vec.X *= f; - vec.Y *= f; - vec.Z *= f; - return vec; - } + public static Vector3d operator *(Vector3d vec, double f) + { + vec.X *= f; + vec.Y *= f; + vec.Z *= f; + return vec; + } - public static Vector3d operator *(double f, Vector3d vec) - { - vec.X *= f; - vec.Y *= f; - vec.Z *= f; - return vec; - } + public static Vector3d operator *(double f, Vector3d vec) + { + vec.X *= f; + vec.Y *= f; + vec.Z *= f; + return vec; + } - public static Vector3d operator /(Vector3d vec, double f) - { - double mult = 1.0f / f; - vec.X *= mult; - vec.Y *= mult; - vec.Z *= mult; - return vec; - } + public static Vector3d operator /(Vector3d vec, double f) + { + double mult = 1.0f / f; + vec.X *= mult; + vec.Y *= mult; + vec.Z *= mult; + return vec; + } public static bool operator ==(Vector3d left, Vector3d right) { @@ -1077,17 +1076,17 @@ namespace OpenTK.Math /// Converts OpenTK.Math.Vector3 to OpenTK.Math.Vector3d. /// The Vector3 to convert. /// The resulting Vector3d. - public static explicit operator Vector3d( Vector3 v3 ) + public static explicit operator Vector3d(Vector3 v3) { - return new Vector3d( v3.X, v3.Y, v3.Z ); + return new Vector3d(v3.X, v3.Y, v3.Z); } /// Converts OpenTK.Math.Vector3d to OpenTK.Math.Vector3. /// The Vector3d to convert. /// The resulting Vector3. - public static explicit operator Vector3( Vector3d v3d ) + public static explicit operator Vector3(Vector3d v3d) { - return new Vector3( (float)v3d.X, (float)v3d.Y, (float)v3d.Z ); + return new Vector3((float)v3d.X, (float)v3d.Y, (float)v3d.Z); } #endregion @@ -1097,15 +1096,15 @@ namespace OpenTK.Math #region public override string ToString() /// - /// Returns a System.String that represents the current Vector3. - /// - /// - public override string ToString() + /// Returns a System.String that represents the current Vector3. + /// + /// + public override string ToString() { return String.Format("({0}, {1}, {2})", X, Y, Z); - } + } - #endregion + #endregion #region public override int GetHashCode() @@ -1144,7 +1143,7 @@ namespace OpenTK.Math #region IEquatable Members /// Indicates whether the current vector is equal to another vector. - /// A vector to compare with this vector. + /// A vector to compare with this vector. /// true if the current vector is equal to the vector parameter; otherwise, false. public bool Equals(Vector3d other) { diff --git a/Source/OpenTK/Math/Vector3h.cs b/Source/OpenTK/Math/Vector3h.cs index 3bbc7469..1992e118 100644 --- a/Source/OpenTK/Math/Vector3h.cs +++ b/Source/OpenTK/Math/Vector3h.cs @@ -215,7 +215,6 @@ namespace OpenTK.Math /// /// Returns this Half3 instance's contents as Vector3d. /// - /// OpenTK.Math.Vector3d public Vector3d ToVector3d() { return new Vector3d(X, Y, Z); @@ -226,7 +225,7 @@ namespace OpenTK.Math #region Conversions /// Converts OpenTK.Math.Vector3 to OpenTK.Math.Half3. - /// The Vector3 to convert. + /// The Vector3 to convert. /// The resulting Half vector. public static explicit operator Vector3h(Vector3 v3f) { @@ -234,7 +233,7 @@ namespace OpenTK.Math } /// Converts OpenTK.Math.Vector3d to OpenTK.Math.Half3. - /// The Vector3d to convert. + /// The Vector3d to convert. /// The resulting Half vector. public static explicit operator Vector3h(Vector3d v3d) { @@ -242,7 +241,7 @@ namespace OpenTK.Math } /// Converts OpenTK.Math.Half3 to OpenTK.Math.Vector3. - /// The Half3 to convert. + /// The Half3 to convert. /// The resulting Vector3. public static explicit operator Vector3(Vector3h h3) { @@ -254,7 +253,7 @@ namespace OpenTK.Math } /// Converts OpenTK.Math.Half3 to OpenTK.Math.Vector3d. - /// The Half3 to convert. + /// The Half3 to convert. /// The resulting Vector3d. public static explicit operator Vector3d(Vector3h h3) { diff --git a/Source/OpenTK/Math/Vector4.cs b/Source/OpenTK/Math/Vector4.cs index 69b62c49..3da9844d 100644 --- a/Source/OpenTK/Math/Vector4.cs +++ b/Source/OpenTK/Math/Vector4.cs @@ -246,7 +246,7 @@ namespace OpenTK.Math /// /// Gets the length (magnitude) of the vector. /// - /// + /// /// public float Length { @@ -269,7 +269,6 @@ namespace OpenTK.Math /// /// /// - /// public float LengthFast { get @@ -290,7 +289,7 @@ namespace OpenTK.Math /// for comparisons. /// /// - /// + /// public float LengthSquared { get @@ -782,7 +781,7 @@ namespace OpenTK.Math #region Transform /// Transform a Vector by the given Matrix - /// The vector to transform + /// The vector to transform /// The desired transformation /// The transformed vector public static Vector4 Transform(Vector4 vec, Matrix4 mat) @@ -796,7 +795,7 @@ namespace OpenTK.Math } /// Transform a Vector by the given Matrix - /// The vector to transform + /// The vector to transform /// The desired transformation /// The transformed vector public static void Transform( ref Vector4 vec, ref Matrix4 mat, out Vector4 result ) @@ -977,7 +976,7 @@ namespace OpenTK.Math #region IEquatable Members /// Indicates whether the current vector is equal to another vector. - /// A vector to compare with this vector. + /// A vector to compare with this vector. /// true if the current vector is equal to the vector parameter; otherwise, false. public bool Equals(Vector4 other) { diff --git a/Source/OpenTK/Math/Vector4d.cs b/Source/OpenTK/Math/Vector4d.cs index ee5954b3..e144069a 100644 --- a/Source/OpenTK/Math/Vector4d.cs +++ b/Source/OpenTK/Math/Vector4d.cs @@ -58,7 +58,7 @@ namespace OpenTK.Math /// /// Defines a unit-length Vector4d that points towards the X-axis. /// - public static Vector4d UnitX = new Vector4d(1, 0, 0, 0); + public static Vector4d UnitX = new Vector4d(1, 0, 0, 0); /// /// Defines a unit-length Vector4d that points towards the Y-axis. @@ -68,17 +68,17 @@ namespace OpenTK.Math /// /// Defines a unit-length Vector4d that points towards the Z-axis. /// - public static Vector4d UnitZ = new Vector4d(0, 0, 1, 0); + public static Vector4d UnitZ = new Vector4d(0, 0, 1, 0); /// /// Defines a unit-length Vector4d that points towards the W-axis. /// - public static Vector4d UnitW = new Vector4d(0, 0, 0, 1); + public static Vector4d UnitW = new Vector4d(0, 0, 0, 1); /// /// Defines a zero-length Vector4d. /// - public static Vector4d Zero = new Vector4d(0, 0, 0, 0); + public static Vector4d Zero = new Vector4d(0, 0, 0, 0); /// /// Defines the size of the Vector4d struct in bytes. @@ -163,7 +163,7 @@ namespace OpenTK.Math /// Add the Vector passed as parameter to this instance. /// Right operand. This parameter is only read from. - public void Add( Vector4d right ) + public void Add(Vector4d right) { this.X += right.X; this.Y += right.Y; @@ -174,7 +174,7 @@ namespace OpenTK.Math /// Add the Vector passed as parameter to this instance. /// Right operand. This parameter is only read from. [CLSCompliant(false)] - public void Add( ref Vector4d right ) + public void Add(ref Vector4d right) { this.X += right.X; this.Y += right.Y; @@ -188,7 +188,7 @@ namespace OpenTK.Math /// Subtract the Vector passed as parameter from this instance. /// Right operand. This parameter is only read from. - public void Sub( Vector4d right ) + public void Sub(Vector4d right) { this.X -= right.X; this.Y -= right.Y; @@ -199,7 +199,7 @@ namespace OpenTK.Math /// Subtract the Vector passed as parameter from this instance. /// Right operand. This parameter is only read from. [CLSCompliant(false)] - public void Sub( ref Vector4d right ) + public void Sub(ref Vector4d right) { this.X -= right.X; this.Y -= right.Y; @@ -213,7 +213,7 @@ namespace OpenTK.Math /// Multiply this instance by a scalar. /// Scalar operand. - public void Mult( double f ) + public void Mult(double f) { this.X *= f; this.Y *= f; @@ -227,7 +227,7 @@ namespace OpenTK.Math /// Divide this instance by a scalar. /// Scalar operand. - public void Div( double f ) + public void Div(double f) { double mult = 1.0 / f; this.X *= mult; @@ -243,7 +243,7 @@ namespace OpenTK.Math /// /// Gets the length (magnitude) of the vector. /// - /// + /// /// public double Length { @@ -266,7 +266,6 @@ namespace OpenTK.Math /// /// /// - /// public double LengthFast { get @@ -287,7 +286,6 @@ namespace OpenTK.Math /// for comparisons. /// /// - /// public double LengthSquared { get @@ -349,7 +347,7 @@ namespace OpenTK.Math /// Scales this instance by the given parameter. /// The scaling of the individual components. - public void Scale( Vector4d scale ) + public void Scale(Vector4d scale) { this.X *= scale.X; this.Y *= scale.Y; @@ -360,7 +358,7 @@ namespace OpenTK.Math /// Scales this instance by the given parameter. /// The scaling of the individual components. [CLSCompliant(false)] - public void Scale( ref Vector4d scale ) + public void Scale(ref Vector4d scale) { this.X *= scale.X; this.Y *= scale.Y; @@ -694,7 +692,7 @@ namespace OpenTK.Math /// First operand /// Second operand /// The dot product of the two inputs - public static void Dot( ref Vector4d left, ref Vector4d right, out double result ) + public static void Dot(ref Vector4d left, ref Vector4d right, out double result) { result = left.X * right.X + left.Y * right.Y + left.Z * right.Z + left.W * right.W; } @@ -726,12 +724,12 @@ namespace OpenTK.Math /// Second input vector /// The blend factor. a when blend=0, b when blend=1. /// a when blend=0, b when blend=1, and a linear combination otherwise - public static void Lerp( ref Vector4d a, ref Vector4d b, double blend, out Vector4d result ) + public static void Lerp(ref Vector4d a, ref Vector4d b, double blend, out Vector4d result) { - result.X = blend * ( b.X - a.X ) + a.X; - result.Y = blend * ( b.Y - a.Y ) + a.Y; - result.Z = blend * ( b.Z - a.Z ) + a.Z; - result.W = blend * ( b.W - a.W ) + a.W; + result.X = blend * (b.X - a.X) + a.X; + result.Y = blend * (b.Y - a.Y) + a.Y; + result.Z = blend * (b.Z - a.Z) + a.Z; + result.W = blend * (b.W - a.W) + a.W; } #endregion @@ -759,19 +757,19 @@ namespace OpenTK.Math /// First Barycentric Coordinate. /// Second Barycentric Coordinate. /// Output Vector. a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise - public static void BaryCentric( ref Vector4d a, ref Vector4d b, ref Vector4d c, float u, float v, out Vector4d result ) + public static void BaryCentric(ref Vector4d a, ref Vector4d b, ref Vector4d c, float u, float v, out Vector4d result) { result = a; // copy Vector4d temp = b; // copy - temp.Sub( ref a ); - temp.Mult( u ); - result.Add( ref temp ); + temp.Sub(ref a); + temp.Mult(u); + result.Add(ref temp); temp = c; // copy - temp.Sub( ref a ); - temp.Mult( v ); - result.Add( ref temp ); + temp.Sub(ref a); + temp.Mult(v); + result.Add(ref temp); } #endregion @@ -779,7 +777,7 @@ namespace OpenTK.Math #region Transform /// Transform a Vector by the given Matrix - /// The vector to transform + /// The vector to transform /// The desired transformation /// The transformed vector public static Vector4d Transform(Vector4d vec, Matrix4d mat) @@ -793,10 +791,10 @@ namespace OpenTK.Math } /// Transform a Vector by the given Matrix - /// The vector to transform + /// The vector to transform /// The desired transformation /// The transformed vector - public static void Transform( ref Vector4d vec, ref Matrix4d mat, out Vector4d result ) + public static void Transform(ref Vector4d vec, ref Matrix4d mat, out Vector4d result) { result.X = vec.X * mat.Row0.X + vec.Y * mat.Row1.X + @@ -843,58 +841,58 @@ namespace OpenTK.Math public static Vector4d operator +(Vector4d left, Vector4d right) { - left.X += right.X; - left.Y += right.Y; - left.Z += right.Z; - left.W += right.W; - return left; + left.X += right.X; + left.Y += right.Y; + left.Z += right.Z; + left.W += right.W; + return left; } public static Vector4d operator -(Vector4d left, Vector4d right) { - left.X -= right.X; - left.Y -= right.Y; - left.Z -= right.Z; - left.W -= right.W; - return left; + left.X -= right.X; + left.Y -= right.Y; + left.Z -= right.Z; + left.W -= right.W; + return left; } - public static Vector4d operator -(Vector4d vec) - { - vec.X = -vec.X; - vec.Y = -vec.Y; - vec.Z = -vec.Z; - vec.W = -vec.W; - return vec; - } + public static Vector4d operator -(Vector4d vec) + { + vec.X = -vec.X; + vec.Y = -vec.Y; + vec.Z = -vec.Z; + vec.W = -vec.W; + return vec; + } - public static Vector4d operator *(Vector4d vec, double f) - { - vec.X *= f; - vec.Y *= f; - vec.Z *= f; - vec.W *= f; - return vec; - } + public static Vector4d operator *(Vector4d vec, double f) + { + vec.X *= f; + vec.Y *= f; + vec.Z *= f; + vec.W *= f; + return vec; + } - public static Vector4d operator *(double f, Vector4d vec) - { - vec.X *= f; - vec.Y *= f; - vec.Z *= f; - vec.W *= f; - return vec; - } + public static Vector4d operator *(double f, Vector4d vec) + { + vec.X *= f; + vec.Y *= f; + vec.Z *= f; + vec.W *= f; + return vec; + } - public static Vector4d operator /(Vector4d vec, double f) - { - double mult = 1.0f / f; - vec.X *= mult; - vec.Y *= mult; - vec.Z *= mult; - vec.W *= mult; - return vec; - } + public static Vector4d operator /(Vector4d vec, double f) + { + double mult = 1.0f / f; + vec.X *= mult; + vec.Y *= mult; + vec.Z *= mult; + vec.W *= mult; + return vec; + } public static bool operator ==(Vector4d left, Vector4d right) { @@ -923,17 +921,17 @@ namespace OpenTK.Math /// Converts OpenTK.Math.Vector4 to OpenTK.Math.Vector4d. /// The Vector4 to convert. /// The resulting Vector4d. - public static explicit operator Vector4d( Vector4 v4 ) + public static explicit operator Vector4d(Vector4 v4) { - return new Vector4d( v4.X, v4.Y, v4.Z, v4.W ); + return new Vector4d(v4.X, v4.Y, v4.Z, v4.W); } /// Converts OpenTK.Math.Vector4d to OpenTK.Math.Vector4. /// The Vector4d to convert. /// The resulting Vector4. - public static explicit operator Vector4( Vector4d v4d ) + public static explicit operator Vector4(Vector4d v4d) { - return new Vector4( (float)v4d.X, (float)v4d.Y, (float)v4d.Z, (float)v4d.W ); + return new Vector4((float)v4d.X, (float)v4d.Y, (float)v4d.Z, (float)v4d.W); } #endregion @@ -943,15 +941,15 @@ namespace OpenTK.Math #region public override string ToString() /// - /// Returns a System.String that represents the current Vector4d. - /// - /// - public override string ToString() + /// Returns a System.String that represents the current Vector4d. + /// + /// + public override string ToString() { return String.Format("({0}, {1}, {2}, {3})", X, Y, Z, W); - } + } - #endregion + #endregion #region public override int GetHashCode() @@ -990,7 +988,7 @@ namespace OpenTK.Math #region IEquatable Members /// Indicates whether the current vector is equal to another vector. - /// A vector to compare with this vector. + /// A vector to compare with this vector. /// true if the current vector is equal to the vector parameter; otherwise, false. public bool Equals(Vector4d other) { diff --git a/Source/OpenTK/Math/Vector4h.cs b/Source/OpenTK/Math/Vector4h.cs index adcf804d..ac44de22 100644 --- a/Source/OpenTK/Math/Vector4h.cs +++ b/Source/OpenTK/Math/Vector4h.cs @@ -238,7 +238,6 @@ namespace OpenTK.Math /// /// Returns this Half4 instance's contents as Vector4d. /// - /// OpenTK.Math.Vector4d public Vector4d ToVector4d() { return new Vector4d(X, Y, Z, W); diff --git a/Source/OpenTK/Platform/MacOS/AglContext.cs b/Source/OpenTK/Platform/MacOS/AglContext.cs index 176bb525..eedae368 100644 --- a/Source/OpenTK/Platform/MacOS/AglContext.cs +++ b/Source/OpenTK/Platform/MacOS/AglContext.cs @@ -29,7 +29,8 @@ namespace OpenTK.Platform.MacOS IntPtr contextRef; bool mVSync = false; - IntPtr displayID; + // Todo: keep track of which display adapter was specified when the context was created. + // IntPtr displayID; GraphicsMode graphics_mode; CarbonWindowInfo carbonWindow; diff --git a/Source/OpenTK/Platform/MacOS/CarbonGLNative.cs b/Source/OpenTK/Platform/MacOS/CarbonGLNative.cs index 860a0698..1fcc3ec9 100644 --- a/Source/OpenTK/Platform/MacOS/CarbonGLNative.cs +++ b/Source/OpenTK/Platform/MacOS/CarbonGLNative.cs @@ -585,7 +585,6 @@ namespace OpenTK.Platform.MacOS this.context.MakeCurrent(window); context = this.context; - } public void DestroyWindow() @@ -641,8 +640,8 @@ namespace OpenTK.Platform.MacOS } } - public event CreateEvent Create; - public event DestroyEvent Destroy; + public event CreateEvent Create = delegate(object sender, EventArgs e) { }; + public event DestroyEvent Destroy = delegate(object sender, EventArgs e) { }; #endregion @@ -654,7 +653,6 @@ namespace OpenTK.Platform.MacOS #region INativeGLWindow Members - public WindowState WindowState { get diff --git a/Source/OpenTK/Platform/Utilities.cs b/Source/OpenTK/Platform/Utilities.cs index f16b9671..f2f69a60 100644 --- a/Source/OpenTK/Platform/Utilities.cs +++ b/Source/OpenTK/Platform/Utilities.cs @@ -249,7 +249,8 @@ namespace OpenTK.Platform /// currently running on. This will create a handle for the control, so it is not /// recommended that this be called in the constructor of a custom control. /// - /// + /// The desired GraphicsMode for this window. + /// A to get the IWindowInfo from. /// public static IWindowInfo CreateWindowInfo(Graphics.GraphicsMode mode, Control cntrl) { @@ -259,6 +260,7 @@ namespace OpenTK.Platform /// Creates an object which implements the IWindowInfo interface for the platform /// currently running on. /// + /// The desired GraphicsMode for this window. /// The handle to the control, obtained from Control.Handle. /// public static IWindowInfo CreateWindowInfo(Graphics.GraphicsMode mode, IntPtr controlHandle) diff --git a/Source/OpenTK/Platform/Windows/API.cs b/Source/OpenTK/Platform/Windows/API.cs index 40cc47da..986d7940 100644 --- a/Source/OpenTK/Platform/Windows/API.cs +++ b/Source/OpenTK/Platform/Windows/API.cs @@ -289,10 +289,9 @@ namespace OpenTK.Platform.Windows /// Low-level WINAPI function that retriives the next message in the queue. /// /// The pending message (if any) is stored here. - /// Not used + /// Not used /// Not used /// Not used - /// Not used /// /// Nonzero indicates that the function retrieves a message other than WM_QUIT. /// Zero indicates that the function retrieves the WM_QUIT message, or that lpMsg is an invalid pointer. @@ -435,7 +434,7 @@ namespace OpenTK.Platform.Windows /// /// /// - /// + /// /// [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] @@ -506,7 +505,7 @@ namespace OpenTK.Platform.Windows /// /// /// - /// + /// /// [DllImport("kernel32.dll", SetLastError = true)] internal static extern IntPtr LoadLibrary(string dllName); @@ -629,7 +628,7 @@ namespace OpenTK.Platform.Windows /// Converts the screen coordinates of a specified point on the screen to client-area coordinates. /// /// Handle to the window whose client area will be used for the conversion. - /// Pointer to a POINT structure that specifies the screen coordinates to be converted. + /// Pointer to a POINT structure that specifies the screen coordinates to be converted. /// If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. Windows NT/2000/XP: To get extended error information, call GetLastError. /// /// The function uses the window identified by the hWnd parameter and the screen coordinates given in the POINT structure to compute client coordinates. It then replaces the screen coordinates with the client coordinates. The new coordinates are relative to the upper-left corner of the specified window's client area. @@ -649,7 +648,7 @@ namespace OpenTK.Platform.Windows /// Converts the client-area coordinates of a specified point to screen coordinates. /// /// Handle to the window whose client area will be used for the conversion. - /// Pointer to a POINT structure that contains the client coordinates to be converted. The new screen coordinates are copied into this structure if the function succeeds. + /// Pointer to a POINT structure that contains the client coordinates to be converted. The new screen coordinates are copied into this structure if the function succeeds. /// If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. Windows NT/2000/XP: To get extended error information, call GetLastError. /// /// The ClientToScreen function replaces the client-area coordinates in the POINT structure with the screen coordinates. The screen coordinates are relative to the upper-left corner of the screen. Note, a screen-coordinate point that is above the window's client area has a negative y-coordinate. Similarly, a screen coordinate to the left of a client area has a negative x-coordinate. @@ -1511,8 +1510,7 @@ namespace OpenTK.Platform.Windows /// character cell. /// /// The values of GlyphMetricsFloat are specified as notional units. - /// - /// + /// [StructLayout(LayoutKind.Sequential)] internal struct GlyphMetricsFloat { @@ -1543,9 +1541,9 @@ namespace OpenTK.Platform.Windows #region PointFloat /// - /// The POINTFLOAT structure contains the x and y coordinates of a point. + /// The PointFloat structure contains the x and y coordinates of a point. /// - /// + /// [StructLayout(LayoutKind.Sequential)] internal struct PointFloat { @@ -3159,10 +3157,10 @@ namespace OpenTK.Platform.Windows #region QueueStatusFlags - [Flags] /// /// Queue status flags for GetQueueStatus() and MsgWaitForMultipleObjects() /// + [Flags] internal enum QueueStatusFlags { /// @@ -3513,7 +3511,7 @@ namespace OpenTK.Platform.Windows #region ShowWindowCommand /// - // ShowWindow() Commands + /// ShowWindow() Commands /// internal enum ShowWindowCommand { diff --git a/Source/OpenTK/Platform/Windows/WglHelper.cs b/Source/OpenTK/Platform/Windows/WglHelper.cs index 5f4b3d25..09933467 100644 --- a/Source/OpenTK/Platform/Windows/WglHelper.cs +++ b/Source/OpenTK/Platform/Windows/WglHelper.cs @@ -134,7 +134,7 @@ namespace OpenTK.Platform.Windows /// /// Checks if a Wgl extension is supported by the given context. /// - /// The device context. + /// The device context. /// The extension to check. /// True if the extension is supported by the given context, false otherwise public static bool SupportsExtension(WinGLContext context, string ext) diff --git a/Source/OpenTK/Platform/Windows/WinMMJoystick.cs b/Source/OpenTK/Platform/Windows/WinMMJoystick.cs index 1fc3bddd..2bc84218 100644 --- a/Source/OpenTK/Platform/Windows/WinMMJoystick.cs +++ b/Source/OpenTK/Platform/Windows/WinMMJoystick.cs @@ -43,9 +43,10 @@ namespace OpenTK.Platform.Windows List sticks = new List(); IList sticks_readonly; - static readonly string RegistryJoyConfig = @"Joystick%dConfiguration"; - static readonly string RegistryJoyName = @"Joystick%dOEMName"; - static readonly string RegstryJoyCurrent = @"CurrentJoystickSettings"; + // Todo: Read the joystick name from the registry. + //static readonly string RegistryJoyConfig = @"Joystick%dConfiguration"; + //static readonly string RegistryJoyName = @"Joystick%dOEMName"; + //static readonly string RegstryJoyCurrent = @"CurrentJoystickSettings"; bool disposed; @@ -113,17 +114,17 @@ namespace OpenTK.Platform.Windows stick.Details.PovType |= PovType.Continuous; } - // Try to get the device name from the registry. Oh joy! - string key_path = String.Format("{0}\\{1}\\{2}", RegistryJoyConfig, caps.RegKey, RegstryJoyCurrent); - RegistryKey key = Registry.LocalMachine.OpenSubKey(key_path, false); - if (key == null) - key = Registry.CurrentUser.OpenSubKey(key_path, false); - if (key == null) - stick.Description = String.Format("USB Joystick {0} ({1} axes, {2} buttons)", number, stick.Axis.Count, stick.Button.Count); - else - { - key.Close(); - } + // Todo: Try to get the device name from the registry. Oh joy! + //string key_path = String.Format("{0}\\{1}\\{2}", RegistryJoyConfig, caps.RegKey, RegstryJoyCurrent); + //RegistryKey key = Registry.LocalMachine.OpenSubKey(key_path, false); + //if (key == null) + // key = Registry.CurrentUser.OpenSubKey(key_path, false); + //if (key == null) + // stick.Description = String.Format("USB Joystick {0} ({1} axes, {2} buttons)", number, stick.Axis.Count, stick.Button.Count); + //else + //{ + // key.Close(); + //} if (stick != null) Debug.Print("Found joystick on device number {0}", number); diff --git a/Source/OpenTK/Platform/X11/API.cs b/Source/OpenTK/Platform/X11/API.cs index 97760786..dfc3b4ae 100644 --- a/Source/OpenTK/Platform/X11/API.cs +++ b/Source/OpenTK/Platform/X11/API.cs @@ -170,7 +170,7 @@ namespace OpenTK.Platform.X11 /// /// A pointer to the structure that will be freed. [DllImport(_dll_name, EntryPoint = "XFree")] - extern public static void Free(IntPtr data); + extern public static void Free(IntPtr buffer); #endregion diff --git a/Source/OpenTK/Platform/X11/Structs.cs b/Source/OpenTK/Platform/X11/Structs.cs index 64a6f116..4600beb8 100644 --- a/Source/OpenTK/Platform/X11/Structs.cs +++ b/Source/OpenTK/Platform/X11/Structs.cs @@ -33,7 +33,7 @@ using System.Drawing; using System.Diagnostics; using System.Runtime.InteropServices; -/// X11 Version +// X11 Version namespace OpenTK.Platform.X11 { //