Fixed a large amount of documentation warnings.

Marked several APIs as obsolete.
This commit is contained in:
the_fiddler 2009-06-04 11:22:20 +00:00
parent 83bcde95f9
commit 5c40ce638d
11 changed files with 252 additions and 178 deletions

View file

@ -15,9 +15,11 @@ using OpenTK.Math;
namespace OpenTK.Audio namespace OpenTK.Audio
{ {
/// <summary>
/// Provides access to the OpenAL effects extension.
/// </summary>
public partial class EffectsExtension public partial class EffectsExtension
{ {
#region Helpers #region Helpers
#region BindEffect #region BindEffect

View file

@ -15,7 +15,11 @@ namespace OpenTK.Audio
{ {
public partial class EffectsExtension public partial class EffectsExtension
{ {
// TODO: CLS compliance. // Todo: Add documentation
// Todo: CLS compliance.
#pragma warning disable 1591
[CLSCompliant(false)] [CLSCompliant(false)]
public struct EaxReverb public struct EaxReverb
{ {
@ -360,6 +364,7 @@ namespace OpenTK.Audio
public static EaxReverb Chapel = new EaxReverb(26, 19.6f, 0.840f, -1000, -500, 0, 4.62f, 0.64f, 1.23f, -700, 0.032f, 0f, 0f, 0f, -200, 0.049f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0.110f, -5f, 5000f, 250f, 0f, 0x3f); public static EaxReverb Chapel = new EaxReverb(26, 19.6f, 0.840f, -1000, -500, 0, 4.62f, 0.64f, 1.23f, -700, 0.032f, 0f, 0f, 0f, -200, 0.049f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0.110f, -5f, 5000f, 250f, 0f, 0x3f);
public static EaxReverb Smallwaterroom = new EaxReverb(26, 36.2f, 0.700f, -1000, -698, 0, 1.51f, 1.25f, 1.14f, -100, 0.020f, 0f, 0f, 0f, 300, 0.030f, 0f, 0f, 0f, 0.179f, 0.150f, 0.895f, 0.190f, -7f, 5000f, 250f, 0f, 0x0); public static EaxReverb Smallwaterroom = new EaxReverb(26, 36.2f, 0.700f, -1000, -698, 0, 1.51f, 1.25f, 1.14f, -100, 0.020f, 0f, 0f, 0f, 300, 0.030f, 0f, 0f, 0f, 0.179f, 0.150f, 0.895f, 0.190f, -7f, 5000f, 250f, 0f, 0x0);
} }
}
#pragma warning restore 1591
}
} }

View file

@ -1,7 +1,28 @@
#region --- License --- #region License
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos //
* See license.txt for license info // The Open Toolkit Library License
*/ //
// Copyright (c) 2006 - 2009 the Open Toolkit library.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion #endregion
using System; using System;
@ -9,8 +30,6 @@ using System;
namespace OpenTK namespace OpenTK
{ {
#region public class ContextExistsException : ApplicationException
/// <summary> /// <summary>
/// This exception is thrown when a GraphicsContext property cannot be changed after creation. /// This exception is thrown when a GraphicsContext property cannot be changed after creation.
/// </summary> /// </summary>
@ -18,11 +37,18 @@ namespace OpenTK
{ {
string msg; string msg;
/// <summary>
/// Constructs a new ContextExistsException instance.
/// </summary>
/// <param name="message">A System.String explaining the cause of this exception.</param>
public ContextExistsException(string message) public ContextExistsException(string message)
{ {
msg = message; msg = message;
} }
/// <summary>
/// Gets a System.String explaining the cause of this exception.
/// </summary>
public override string Message public override string Message
{ {
get get
@ -31,6 +57,4 @@ namespace OpenTK
} }
} }
} }
#endregion
} }

View file

@ -25,14 +25,7 @@ namespace OpenTK.Graphics
#region public DisplayResolution(int width, int height, int bitsPerPixel, float refreshRate) #region public DisplayResolution(int width, int height, int bitsPerPixel, float refreshRate)
/// <summary> // Creates a new DisplayResolution object for the primary DisplayDevice.
/// Creates a new DisplayResolution object for the primary DisplayDevice.
/// </summary>
/// <param name="width">The requested width in pixels.</param>
/// <param name="height">The requested height in pixels.</param>
/// <param name="bitsPerPixel">The requested bits per pixel in bits.</param>
/// <param name="refreshRate">The requested refresh rate in Herz.</param>
/// <remarks>OpenTK will select the closest match between all available resolutions on the primary DisplayDevice.</remarks>
internal DisplayResolution(int x, int y, int width, int height, int bitsPerPixel, float refreshRate) internal DisplayResolution(int x, int y, int width, int height, int bitsPerPixel, float refreshRate)
{ {
// Refresh rate may be zero, since this information may not be available on some platforms. // Refresh rate may be zero, since this information may not be available on some platforms.

View file

@ -614,6 +614,11 @@ namespace OpenTK.Graphics
#region --- GL Overloads --- #region --- GL Overloads ---
#pragma warning disable 3019
#pragma warning disable 1591
#pragma warning disable 1572
#pragma warning disable 1573
#region public static void Color[34]() overloads #region public static void Color[34]() overloads
public static void Color3(System.Drawing.Color color) public static void Color3(System.Drawing.Color color)
@ -1242,6 +1247,11 @@ namespace OpenTK.Graphics
#endregion #endregion
#pragma warning restore 3019
#pragma warning restore 1591
#pragma warning restore 1572
#pragma warning restore 1573
#endregion #endregion
} }
} }

View file

@ -384,6 +384,7 @@ namespace OpenTK.Graphics
/// <summary> /// <summary>
/// Raised when a Context is destroyed. /// Raised when a Context is destroyed.
/// </summary> /// </summary>
[Obsolete]
public event DestroyEvent<IGraphicsContext> Destroy public event DestroyEvent<IGraphicsContext> Destroy
{ {
add { implementation.Destroy += value; } add { implementation.Destroy += value; }

View file

@ -65,6 +65,7 @@ namespace OpenTK.Graphics
bool ErrorChecking { get; set; } bool ErrorChecking { get; set; }
} }
[Obsolete]
public delegate void DestroyEvent<T>(T sender, EventArgs e); public delegate void DestroyEvent<T>(T sender, EventArgs e);
// Functions for internal use by OpenTK. // Functions for internal use by OpenTK.
@ -75,18 +76,14 @@ namespace OpenTK.Graphics
/// </summary> /// </summary>
public interface IGraphicsContextInternal public interface IGraphicsContextInternal
{ {
/// <summary>
/// Gets the internal implementation of the current instance.
/// </summary>
IGraphicsContext Implementation { get; } IGraphicsContext Implementation { get; }
///// <summary> /// <summary>
///// Creates an OpenGL context with the specified direct/indirect rendering mode and sharing state with the /// Prepares the entry points for OpenGL.
///// specified IGraphicsContext. /// </summary>
///// </summary>
///// <param name="direct">Set to true for direct rendering or false otherwise.</param>
///// <param name="source">The source IGraphicsContext to share state from.</param>.
///// <seealso cref="CreateContext(bool)"/>
//void CreateContext(bool direct, IGraphicsContext source);
/// <summary>Prepares the entry points for OpenGL.</summary>
void LoadAll(); void LoadAll();
/// <summary> /// <summary>
@ -94,18 +91,6 @@ namespace OpenTK.Graphics
/// </summary> /// </summary>
ContextHandle Context { get; } ContextHandle Context { get; }
// <summary>
// Gets the IWindowInfo describing the window associated with this context.
// </summary>
//IWindowInfo Info { get; }
///// <summary>
///// Gets a System.IntPtr containing the handle to the OpenGL context which is current in the
///// calling thread, or IntPtr.Zero if no OpenGL context is current.
///// </summary>
///// <returns>A System.IntPtr that holds the handle to the current OpenGL context.</returns>
//ContextHandle GetCurrentContext();
/// <summary> /// <summary>
/// Registers an OpenGL resource for disposal. /// Registers an OpenGL resource for disposal.
/// </summary> /// </summary>
@ -116,11 +101,13 @@ namespace OpenTK.Graphics
/// a resource for disposal during the finalizer call, and call DisposeResources() /// a resource for disposal during the finalizer call, and call DisposeResources()
/// from the main thread to dispose it. /// from the main thread to dispose it.
/// </remarks> /// </remarks>
[Obsolete]
void RegisterForDisposal(IDisposable resource); void RegisterForDisposal(IDisposable resource);
/// <summary> /// <summary>
/// Disposes all registered OpenGL resources. /// Disposes all registered OpenGL resources.
/// </summary> /// </summary>
[Obsolete]
void DisposeResources(); void DisposeResources();
/// <summary> /// <summary>
@ -131,7 +118,6 @@ namespace OpenTK.Graphics
/// A pointer to the specified function or IntPtr.Zero if the function isn't /// A pointer to the specified function or IntPtr.Zero if the function isn't
/// available in the current opengl context. /// available in the current opengl context.
/// </returns> /// </returns>
// /// <see cref="Marshal.GetDelegateForFunctionPointer"/>
IntPtr GetAddress(string function); IntPtr GetAddress(string function);
} }
} }

View file

@ -77,9 +77,4 @@ namespace OpenTK.Platform
/// </summary> /// </summary>
event EventHandler<FrameEventArgs> RenderFrame; event EventHandler<FrameEventArgs> RenderFrame;
} }
[Obsolete] public delegate void UpdateFrameEvent(GameWindow sender, UpdateFrameEventArgs e);
[Obsolete] public delegate void RenderFrameEvent(GameWindow sender, RenderFrameEventArgs e);
[Obsolete] public delegate void LoadEvent(GameWindow sender, EventArgs e);
[Obsolete] public delegate void UnloadEvent(GameWindow sender, EventArgs e);
} }

View file

@ -70,12 +70,12 @@ namespace OpenTK
IWindowInfo WindowInfo { get; } IWindowInfo WindowInfo { get; }
/// <summary> /// <summary>
/// Gets or sets the <see cref="OpenTK.WindowState"> for this window. /// Gets or sets the <see cref="OpenTK.WindowState"/> for this window.
/// </summary> /// </summary>
WindowState WindowState { get; set; } WindowState WindowState { get; set; }
/// <summary> /// <summary>
/// Gets or sets the <see cref="OpenTK.WindowBorder"> for this window. /// Gets or sets the <see cref="OpenTK.WindowBorder"/> for this window.
/// </summary> /// </summary>
WindowBorder WindowBorder { get; set; } WindowBorder WindowBorder { get; set; }
@ -86,12 +86,12 @@ namespace OpenTK
Rectangle Bounds { get; set; } Rectangle Bounds { get; set; }
/// <summary> /// <summary>
/// Gets or sets a <see cref="System.Drawing.Point"> structure that contains the location of this window on the desktop. /// Gets or sets a <see cref="System.Drawing.Point"/> structure that contains the location of this window on the desktop.
/// </summary> /// </summary>
Point Location { get; set; } Point Location { get; set; }
/// <summary> /// <summary>
/// Gets or sets a <see cref="System.Drawing.Size"> structure that contains the external size of this window. /// Gets or sets a <see cref="System.Drawing.Size"/> structure that contains the external size of this window.
/// </summary> /// </summary>
Size Size { get; set; } Size Size { get; set; }

View file

@ -99,6 +99,17 @@ namespace OpenTK.Math
} }
} }
/// <summary>
/// Returns an approximation of the inverse square root of left number.
/// </summary>
/// <param name="x">A number.</param>
/// <returns>An approximation of the inverse square root of the specified number, with an upper error bound of 0.001</returns>
/// <remarks>
/// This is an improved implementation of the the method known as Carmack's inverse square root
/// which is found in the Quake III source code. This implementation comes from
/// http://www.codemaestro.com/reviews/review00000105.html. For the history of this method, see
/// http://www.beyond3d.com/content/articles/8/
/// </remarks>
public static double InverseSqrtFast(double x) public static double InverseSqrtFast(double x)
{ {
return InverseSqrtFast((float)x); return InverseSqrtFast((float)x);

View file

@ -348,7 +348,7 @@ namespace OpenTK.Math
#region Add #region Add
/// <summary> /// <summary>
/// Add two Vectors /// Add the specified instances
/// </summary> /// </summary>
/// <param name="a">First operand</param> /// <param name="a">First operand</param>
/// <param name="b">Second operand</param> /// <param name="b">Second operand</param>
@ -741,6 +741,12 @@ namespace OpenTK.Math
#region Operators #region Operators
/// <summary>
/// Adds the specified instances.
/// </summary>
/// <param name="left">Left operand.</param>
/// <param name="right">Right operand.</param>
/// <returns>Result of addition.</returns>
public static Vector2 operator +(Vector2 left, Vector2 right) public static Vector2 operator +(Vector2 left, Vector2 right)
{ {
left.X += right.X; left.X += right.X;
@ -748,6 +754,12 @@ namespace OpenTK.Math
return left; return left;
} }
/// <summary>
/// Subtracts the specified instances.
/// </summary>
/// <param name="left">Left operand.</param>
/// <param name="right">Right operand.</param>
/// <returns>Result of subtraction.</returns>
public static Vector2 operator -(Vector2 left, Vector2 right) public static Vector2 operator -(Vector2 left, Vector2 right)
{ {
left.X -= right.X; left.X -= right.X;
@ -755,6 +767,11 @@ namespace OpenTK.Math
return left; return left;
} }
/// <summary>
/// Negates the specified instance.
/// </summary>
/// <param name="vec">Operand.</param>
/// <returns>Result of negation.</returns>
public static Vector2 operator -(Vector2 vec) public static Vector2 operator -(Vector2 vec)
{ {
vec.X = -vec.X; vec.X = -vec.X;
@ -762,33 +779,63 @@ namespace OpenTK.Math
return vec; return vec;
} }
public static Vector2 operator *(Vector2 vec, float f) /// <summary>
/// Multiplies the specified instance by a scalar.
/// </summary>
/// <param name="vec">Left operand.</param>
/// <param name="scale">Right operand.</param>
/// <returns>Result of multiplication.</returns>
public static Vector2 operator *(Vector2 vec, float scale)
{ {
vec.X *= f; vec.X *= scale;
vec.Y *= f; vec.Y *= scale;
return vec; return vec;
} }
public static Vector2 operator *(float f, Vector2 vec) /// <summary>
/// Multiplies the specified instance by a scalar.
/// </summary>
/// <param name="scale">Left operand.</param>
/// <param name="vec">Right operand.</param>
/// <returns>Result of multiplication.</returns>
public static Vector2 operator *(float scale, Vector2 vec)
{ {
vec.X *= f; vec.X *= scale;
vec.Y *= f; vec.Y *= scale;
return vec; return vec;
} }
public static Vector2 operator /(Vector2 vec, float f) /// <summary>
/// Divides the specified instance by a scalar.
/// </summary>
/// <param name="vec">Left operand</param>
/// <param name="scale">Right operand</param>
/// <returns>Result of the division.</returns>
public static Vector2 operator /(Vector2 vec, float scale)
{ {
float mult = 1.0f / f; float mult = 1.0f / scale;
vec.X *= mult; vec.X *= mult;
vec.Y *= mult; vec.Y *= mult;
return vec; return vec;
} }
/// <summary>
/// Compares the specified instances for equality.
/// </summary>
/// <param name="left">Left operand.</param>
/// <param name="right">Right operand.</param>
/// <returns>True if both instances are equal; false otherwise.</returns>
public static bool operator ==(Vector2 left, Vector2 right) public static bool operator ==(Vector2 left, Vector2 right)
{ {
return left.Equals(right); return left.Equals(right);
} }
/// <summary>
/// Compares the specified instances for inequality.
/// </summary>
/// <param name="left">Left operand.</param>
/// <param name="right">Right operand.</param>
/// <returns>True if both instances are not equal; false otherwise.</returns>
public static bool operator !=(Vector2 left, Vector2 right) public static bool operator !=(Vector2 left, Vector2 right)
{ {
return !left.Equals(right); return !left.Equals(right);