From f0a9afaccecb4d129773214a0ef30eaec8dfa651 Mon Sep 17 00:00:00 2001 From: Tamme Schichler Date: Thu, 24 Jan 2013 01:26:33 +0100 Subject: [PATCH 1/4] Fixed a few warnings with XML comments --- Source/OpenTK/DisplayDevice.cs | 4 ++-- Source/OpenTK/Math/Matrix3.cs | 2 +- Source/OpenTK/Math/Matrix3d.cs | 2 +- Source/OpenTK/Math/Matrix4.cs | 2 +- Source/OpenTK/NativeWindow.cs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/OpenTK/DisplayDevice.cs b/Source/OpenTK/DisplayDevice.cs index 13380180..b90a3273 100644 --- a/Source/OpenTK/DisplayDevice.cs +++ b/Source/OpenTK/DisplayDevice.cs @@ -322,9 +322,9 @@ namespace OpenTK #region GetDisplay /// - /// Gets the for the specified . + /// Gets the for the specified . /// - /// The that defines the desired display. + /// The that defines the desired display. /// A or null, if no device corresponds to the specified index. public static DisplayDevice GetDisplay(DisplayIndex index) { diff --git a/Source/OpenTK/Math/Matrix3.cs b/Source/OpenTK/Math/Matrix3.cs index c3244749..4c594930 100644 --- a/Source/OpenTK/Math/Matrix3.cs +++ b/Source/OpenTK/Math/Matrix3.cs @@ -410,7 +410,7 @@ namespace OpenTK /// Scale factor for the x axis. /// Scale factor for the y axis. /// Scale factor for the z axis. - /// A scale matrix. + /// A scale matrix. public static void CreateScale(float x, float y, float z, out Matrix3 result) { result = Identity; diff --git a/Source/OpenTK/Math/Matrix3d.cs b/Source/OpenTK/Math/Matrix3d.cs index 69310356..21aa8c9e 100644 --- a/Source/OpenTK/Math/Matrix3d.cs +++ b/Source/OpenTK/Math/Matrix3d.cs @@ -410,7 +410,7 @@ namespace OpenTK /// Scale factor for the x axis. /// Scale factor for the y axis. /// Scale factor for the z axis. - /// A scale matrix. + /// A scale matrix. public static void CreateScale(double x, double y, double z, out Matrix3d result) { result = Identity; diff --git a/Source/OpenTK/Math/Matrix4.cs b/Source/OpenTK/Math/Matrix4.cs index f27de106..a67cf0df 100644 --- a/Source/OpenTK/Math/Matrix4.cs +++ b/Source/OpenTK/Math/Matrix4.cs @@ -613,7 +613,7 @@ namespace OpenTK /// Scale factor for the x axis. /// Scale factor for the y axis. /// Scale factor for the z axis. - /// A scale matrix. + /// A scale matrix. public static void CreateScale(float x, float y, float z, out Matrix4 result) { result = Identity; diff --git a/Source/OpenTK/NativeWindow.cs b/Source/OpenTK/NativeWindow.cs index 3d67c4bb..38ab3cc6 100644 --- a/Source/OpenTK/NativeWindow.cs +++ b/Source/OpenTK/NativeWindow.cs @@ -821,7 +821,7 @@ namespace OpenTK /// /// Called when a keybord key is released. /// - /// The for this event. + /// The for this event. protected virtual void OnKeyUp(KeyboardKeyEventArgs e) { KeyUp(this, e); From 56430c7751710b06dba8e22d5cc3b05699ad1672 Mon Sep 17 00:00:00 2001 From: Tamme Schichler Date: Thu, 24 Jan 2013 01:28:53 +0100 Subject: [PATCH 2/4] Added missing XML comments for Matrix3d Fixed a few small issues in XML comments for Matrix4d --HG-- extra : rebase_source : 18595a2fc57dcf7ff0f61d699e092be036d65157 --- Source/OpenTK/Math/Matrix3d.cs | 141 ++++++++++++++++++++++++++++----- Source/OpenTK/Math/Matrix4d.cs | 16 ++-- 2 files changed, 129 insertions(+), 28 deletions(-) diff --git a/Source/OpenTK/Math/Matrix3d.cs b/Source/OpenTK/Math/Matrix3d.cs index 21aa8c9e..d0ed5ba6 100644 --- a/Source/OpenTK/Math/Matrix3d.cs +++ b/Source/OpenTK/Math/Matrix3d.cs @@ -192,7 +192,10 @@ namespace OpenTK #region Instance #region public void Invert() - + + /// + /// Converts this instance into its inverse. + /// public void Invert() { this = Matrix3d.Invert(this); @@ -201,7 +204,10 @@ namespace OpenTK #endregion #region public void Transpose() - + + /// + /// Converts this instance into its transpose. + /// public void Transpose() { this = Matrix3d.Transpose(this); @@ -214,7 +220,13 @@ namespace OpenTK #region Static #region CreateFromAxisAngle - + + /// + /// Build a rotation matrix from the specified axis/angle rotation. + /// + /// The axis to rotate about. + /// Angle in radians to rotate counter-clockwise (looking in the direction of the given axis). + /// A matrix instance. public static void CreateFromAxisAngle(Vector3d axis, double angle, out Matrix3d result) { //normalize and create a local copy of the vector. @@ -248,7 +260,13 @@ namespace OpenTK result.Row2.Y = tYZ + sinX; result.Row2.Z = tZZ + cos; } - + + /// + /// Build a rotation matrix from the specified axis/angle rotation. + /// + /// The axis to rotate about. + /// Angle in radians to rotate counter-clockwise (looking in the direction of the given axis). + /// A matrix instance. public static Matrix3d CreateFromAxisAngle(Vector3d axis, double angle) { Matrix3d result; @@ -259,7 +277,12 @@ namespace OpenTK #endregion #region CreateFromQuaternion - + + /// + /// Build a rotation matrix from the specified quaternion. + /// + /// Quaternion to translate. + /// Matrix result. public static void CreateFromQuaternion(ref Quaterniond q, out Matrix3d result) { Vector3d axis; @@ -267,7 +290,12 @@ namespace OpenTK q.ToAxisAngle(out axis, out angle); CreateFromAxisAngle(axis, angle, out result); } - + + /// + /// Build a rotation matrix from the specified quaternion. + /// + /// Quaternion to translate. + /// A matrix instance. public static Matrix3d CreateFromQuaternion(Quaterniond q) { Matrix3d result; @@ -278,7 +306,12 @@ namespace OpenTK #endregion #region CreateRotation[XYZ] - + + /// + /// Builds a rotation matrix for a rotation around the x-axis. + /// + /// The counter-clockwise angle in radians. + /// The resulting Matrix3d instance. public static void CreateRotationX(double angle, out Matrix3d result) { double cos = System.Math.Cos(angle); @@ -290,14 +323,24 @@ namespace OpenTK result.Row2.Y = -sin; result.Row2.Z = cos; } - + + /// + /// Builds a rotation matrix for a rotation around the x-axis. + /// + /// The counter-clockwise angle in radians. + /// The resulting Matrix3d instance. public static Matrix3d CreateRotationX(double angle) { Matrix3d result; CreateRotationX(angle, out result); return result; } - + + /// + /// Builds a rotation matrix for a rotation around the y-axis. + /// + /// The counter-clockwise angle in radians. + /// The resulting Matrix3d instance. public static void CreateRotationY(double angle, out Matrix3d result) { double cos = System.Math.Cos(angle); @@ -309,14 +352,24 @@ namespace OpenTK result.Row2.X = sin; result.Row2.Z = cos; } - + + /// + /// Builds a rotation matrix for a rotation around the y-axis. + /// + /// The counter-clockwise angle in radians. + /// The resulting Matrix3d instance. public static Matrix3d CreateRotationY(double angle) { Matrix3d result; CreateRotationY(angle, out result); return result; } - + + /// + /// Builds a rotation matrix for a rotation around the z-axis. + /// + /// The counter-clockwise angle in radians. + /// The resulting Matrix3d instance. public static void CreateRotationZ(double angle, out Matrix3d result) { double cos = System.Math.Cos(angle); @@ -328,7 +381,12 @@ namespace OpenTK result.Row1.X = -sin; result.Row1.Y = cos; } - + + /// + /// Builds a rotation matrix for a rotation around the z-axis. + /// + /// The counter-clockwise angle in radians. + /// The resulting Matrix3d instance. public static Matrix3d CreateRotationZ(double angle) { Matrix3d result; @@ -422,14 +480,26 @@ namespace OpenTK #endregion #region Multiply Functions - + + /// + /// Multiplies two instances. + /// + /// The left operand of the multiplication. + /// The right operand of the multiplication. + /// A new instance that is the result of the multiplication public static Matrix3d Mult(Matrix3d left, Matrix3d right) { Matrix3d result; Mult(ref left, ref right, out result); return result; } - + + /// + /// Multiplies two instances. + /// + /// The left operand of the multiplication. + /// The right operand of the multiplication. + /// A new instance that is the result of the multiplication public static void Mult(ref Matrix3d left, ref Matrix3d right, out Matrix3d result) { double lM11 = left.Row0.X, lM12 = left.Row0.Y, lM13 = left.Row0.Z, @@ -578,12 +648,22 @@ namespace OpenTK #endregion #region Transpose - + + /// + /// Calculate the transpose of the given matrix + /// + /// The matrix to transpose + /// The transpose of the given matrix public static Matrix3d Transpose(Matrix3d mat) { return new Matrix3d(mat.Column0, mat.Column1, mat.Column2); } - + + /// + /// Calculate the transpose of the given matrix + /// + /// The matrix to transpose + /// The result of the calculation public static void Transpose(ref Matrix3d mat, out Matrix3d result) { result.Row0 = mat.Column0; @@ -596,17 +676,35 @@ namespace OpenTK #endregion #region Operators - + + /// + /// Matrix multiplication + /// + /// left-hand operand + /// right-hand operand + /// A new Matrix3d which holds the result of the multiplication public static Matrix3d operator *(Matrix3d left, Matrix3d right) { return Matrix3d.Mult(left, right); } - + + /// + /// Compares two instances for equality. + /// + /// The first instance. + /// The second instance. + /// True, if left equals right; false otherwise. public static bool operator ==(Matrix3d left, Matrix3d right) { return left.Equals(right); } - + + /// + /// Compares two instances for inequality. + /// + /// The first instance. + /// The second instance. + /// True, if left does not equal right; false otherwise. public static bool operator !=(Matrix3d left, Matrix3d right) { return !left.Equals(right); @@ -664,7 +762,10 @@ namespace OpenTK #endregion #region IEquatable Members - + + /// Indicates whether the current matrix is equal to another matrix. + /// A matrix to compare with this matrix. + /// true if the current matrix is equal to the matrix parameter; otherwise, false. public bool Equals(Matrix3d other) { return diff --git a/Source/OpenTK/Math/Matrix4d.cs b/Source/OpenTK/Math/Matrix4d.cs index 7653f016..34896c93 100644 --- a/Source/OpenTK/Math/Matrix4d.cs +++ b/Source/OpenTK/Math/Matrix4d.cs @@ -336,7 +336,7 @@ namespace OpenTK /// Builds a rotation matrix for a rotation around the x-axis. /// /// The counter-clockwise angle in radians. - /// The resulting Matrix4 instance. + /// The resulting Matrix4d instance. public static void CreateRotationX(double angle, out Matrix4d result) { double cos = System.Math.Cos(angle); @@ -352,7 +352,7 @@ namespace OpenTK /// Builds a rotation matrix for a rotation around the x-axis. /// /// The counter-clockwise angle in radians. - /// The resulting Matrix4 instance. + /// The resulting Matrix4d instance. public static Matrix4d CreateRotationX(double angle) { Matrix4d result; @@ -364,7 +364,7 @@ namespace OpenTK /// Builds a rotation matrix for a rotation around the y-axis. /// /// The counter-clockwise angle in radians. - /// The resulting Matrix4 instance. + /// The resulting Matrix4d instance. public static void CreateRotationY(double angle, out Matrix4d result) { double cos = System.Math.Cos(angle); @@ -380,7 +380,7 @@ namespace OpenTK /// Builds a rotation matrix for a rotation around the y-axis. /// /// The counter-clockwise angle in radians. - /// The resulting Matrix4 instance. + /// The resulting Matrix4d instance. public static Matrix4d CreateRotationY(double angle) { Matrix4d result; @@ -392,7 +392,7 @@ namespace OpenTK /// Builds a rotation matrix for a rotation around the z-axis. /// /// The counter-clockwise angle in radians. - /// The resulting Matrix4 instance. + /// The resulting Matrix4d instance. public static void CreateRotationZ(double angle, out Matrix4d result) { double cos = System.Math.Cos(angle); @@ -408,7 +408,7 @@ namespace OpenTK /// Builds a rotation matrix for a rotation around the z-axis. /// /// The counter-clockwise angle in radians. - /// The resulting Matrix4 instance. + /// The resulting Matrix4d instance. public static Matrix4d CreateRotationZ(double angle) { Matrix4d result; @@ -1220,7 +1220,7 @@ namespace OpenTK /// /// left-hand operand /// right-hand operand - /// A new Matrix44 which holds the result of the multiplication + /// A new Matrix4d which holds the result of the multiplication public static Matrix4d operator *(Matrix4d left, Matrix4d right) { return Matrix4d.Mult(left, right); @@ -1302,7 +1302,7 @@ namespace OpenTK #region IEquatable Members /// Indicates whether the current matrix is equal to another matrix. - /// An matrix to compare with this matrix. + /// A matrix to compare with this matrix. /// true if the current matrix is equal to the matrix parameter; otherwise, false. public bool Equals(Matrix4d other) { From f455176d2be681627beab39238c7b60de63f49e9 Mon Sep 17 00:00:00 2001 From: Tamme Schichler Date: Thu, 24 Jan 2013 01:53:40 +0100 Subject: [PATCH 3/4] Added missing XML comments for Matrix3d --- Source/OpenTK/Math/Matrix3.cs | 141 +++++++++++++++++++++++++++++----- 1 file changed, 121 insertions(+), 20 deletions(-) diff --git a/Source/OpenTK/Math/Matrix3.cs b/Source/OpenTK/Math/Matrix3.cs index 4c594930..9278e32b 100644 --- a/Source/OpenTK/Math/Matrix3.cs +++ b/Source/OpenTK/Math/Matrix3.cs @@ -192,7 +192,10 @@ namespace OpenTK #region Instance #region public void Invert() - + + /// + /// Converts this instance into its inverse. + /// public void Invert() { this = Matrix3.Invert(this); @@ -201,7 +204,10 @@ namespace OpenTK #endregion #region public void Transpose() - + + /// + /// Converts this instance into its transpose. + /// public void Transpose() { this = Matrix3.Transpose(this); @@ -214,7 +220,13 @@ namespace OpenTK #region Static #region CreateFromAxisAngle - + + /// + /// Build a rotation matrix from the specified axis/angle rotation. + /// + /// The axis to rotate about. + /// Angle in radians to rotate counter-clockwise (looking in the direction of the given axis). + /// A matrix instance. public static void CreateFromAxisAngle(Vector3 axis, float angle, out Matrix3 result) { //normalize and create a local copy of the vector. @@ -248,7 +260,13 @@ namespace OpenTK result.Row2.Y = tYZ + sinX; result.Row2.Z = tZZ + cos; } - + + /// + /// Build a rotation matrix from the specified axis/angle rotation. + /// + /// The axis to rotate about. + /// Angle in radians to rotate counter-clockwise (looking in the direction of the given axis). + /// A matrix instance. public static Matrix3 CreateFromAxisAngle(Vector3 axis, float angle) { Matrix3 result; @@ -259,7 +277,12 @@ namespace OpenTK #endregion #region CreateFromQuaternion - + + /// + /// Build a rotation matrix from the specified quaternion. + /// + /// Quaternion to translate. + /// Matrix result. public static void CreateFromQuaternion(ref Quaternion q, out Matrix3 result) { Vector3 axis; @@ -267,7 +290,12 @@ namespace OpenTK q.ToAxisAngle(out axis, out angle); CreateFromAxisAngle(axis, angle, out result); } - + + /// + /// Build a rotation matrix from the specified quaternion. + /// + /// Quaternion to translate. + /// A matrix instance. public static Matrix3 CreateFromQuaternion(Quaternion q) { Matrix3 result; @@ -278,7 +306,12 @@ namespace OpenTK #endregion #region CreateRotation[XYZ] - + + /// + /// Builds a rotation matrix for a rotation around the x-axis. + /// + /// The counter-clockwise angle in radians. + /// The resulting Matrix3 instance. public static void CreateRotationX(float angle, out Matrix3 result) { float cos = (float)System.Math.Cos(angle); @@ -290,14 +323,24 @@ namespace OpenTK result.Row2.Y = -sin; result.Row2.Z = cos; } - + + /// + /// Builds a rotation matrix for a rotation around the x-axis. + /// + /// The counter-clockwise angle in radians. + /// The resulting Matrix3 instance. public static Matrix3 CreateRotationX(float angle) { Matrix3 result; CreateRotationX(angle, out result); return result; } - + + /// + /// Builds a rotation matrix for a rotation around the y-axis. + /// + /// The counter-clockwise angle in radians. + /// The resulting Matrix3 instance. public static void CreateRotationY(float angle, out Matrix3 result) { float cos = (float)System.Math.Cos(angle); @@ -309,14 +352,24 @@ namespace OpenTK result.Row2.X = sin; result.Row2.Z = cos; } - + + /// + /// Builds a rotation matrix for a rotation around the y-axis. + /// + /// The counter-clockwise angle in radians. + /// The resulting Matrix3 instance. public static Matrix3 CreateRotationY(float angle) { Matrix3 result; CreateRotationY(angle, out result); return result; } - + + /// + /// Builds a rotation matrix for a rotation around the z-axis. + /// + /// The counter-clockwise angle in radians. + /// The resulting Matrix3 instance. public static void CreateRotationZ(float angle, out Matrix3 result) { float cos = (float)System.Math.Cos(angle); @@ -328,7 +381,12 @@ namespace OpenTK result.Row1.X = -sin; result.Row1.Y = cos; } - + + /// + /// Builds a rotation matrix for a rotation around the z-axis. + /// + /// The counter-clockwise angle in radians. + /// The resulting Matrix3 instance. public static Matrix3 CreateRotationZ(float angle) { Matrix3 result; @@ -422,14 +480,26 @@ namespace OpenTK #endregion #region Multiply Functions - + + /// + /// Multiplies two instances. + /// + /// The left operand of the multiplication. + /// The right operand of the multiplication. + /// A new instance that is the result of the multiplication public static Matrix3 Mult(Matrix3 left, Matrix3 right) { Matrix3 result; Mult(ref left, ref right, out result); return result; } - + + /// + /// Multiplies two instances. + /// + /// The left operand of the multiplication. + /// The right operand of the multiplication. + /// A new instance that is the result of the multiplication public static void Mult(ref Matrix3 left, ref Matrix3 right, out Matrix3 result) { float lM11 = left.Row0.X, lM12 = left.Row0.Y, lM13 = left.Row0.Z, @@ -578,12 +648,22 @@ namespace OpenTK #endregion #region Transpose - + + /// + /// Calculate the transpose of the given matrix + /// + /// The matrix to transpose + /// The transpose of the given matrix public static Matrix3 Transpose(Matrix3 mat) { return new Matrix3(mat.Column0, mat.Column1, mat.Column2); } - + + /// + /// Calculate the transpose of the given matrix + /// + /// The matrix to transpose + /// The result of the calculation public static void Transpose(ref Matrix3 mat, out Matrix3 result) { result.Row0 = mat.Column0; @@ -596,17 +676,35 @@ namespace OpenTK #endregion #region Operators - + + /// + /// Matrix multiplication + /// + /// left-hand operand + /// right-hand operand + /// A new Matrix3d which holds the result of the multiplication public static Matrix3 operator *(Matrix3 left, Matrix3 right) { return Matrix3.Mult(left, right); } - + + /// + /// Compares two instances for equality. + /// + /// The first instance. + /// The second instance. + /// True, if left equals right; false otherwise. public static bool operator ==(Matrix3 left, Matrix3 right) { return left.Equals(right); } - + + /// + /// Compares two instances for inequality. + /// + /// The first instance. + /// The second instance. + /// True, if left does not equal right; false otherwise. public static bool operator !=(Matrix3 left, Matrix3 right) { return !left.Equals(right); @@ -664,7 +762,10 @@ namespace OpenTK #endregion #region IEquatable Members - + + /// Indicates whether the current matrix is equal to another matrix. + /// A matrix to compare with this matrix. + /// true if the current matrix is equal to the matrix parameter; otherwise, false. public bool Equals(Matrix3 other) { return From af74d979031dda49dd084d00c05d5c9b403cb0f2 Mon Sep 17 00:00:00 2001 From: Jacob Hauberg Hansen Date: Sat, 26 Jan 2013 14:27:26 +0100 Subject: [PATCH 4/4] Fix NullPointerException on Windows 8. --- Source/OpenTK/Platform/Windows/WinRawKeyboard.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/OpenTK/Platform/Windows/WinRawKeyboard.cs b/Source/OpenTK/Platform/Windows/WinRawKeyboard.cs index a81b29b9..32faae1c 100644 --- a/Source/OpenTK/Platform/Windows/WinRawKeyboard.cs +++ b/Source/OpenTK/Platform/Windows/WinRawKeyboard.cs @@ -108,7 +108,7 @@ namespace OpenTK.Platform.Windows string deviceClassGUID = (string)regkey.GetValue("ClassGUID"); // for windows 8 support via OpenTK issue 3198 // making a guess at backwards compatability. Not sure what older windows returns in these cases... - if(deviceClass != null || deviceClass.Equals(string.Empty)){ + if(deviceClass == null || deviceClass.Equals(string.Empty)){ RegistryKey classGUIDKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Class\" + deviceClassGUID); deviceClass = classGUIDKey != null ? (string) classGUIDKey.GetValue("Class") : string.Empty; }