Merge pull request #559 from Nihlus/purge-region

Purge region declarations
This commit is contained in:
Jarl Gullberg 2017-07-05 20:22:59 +02:00 committed by GitHub
commit 3cf88759eb
329 changed files with 3214 additions and 12368 deletions

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2013 Stefanos Apostolopoulos for the Open Toolkit Library
@ -24,9 +23,6 @@
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.IO;
using System.Text.RegularExpressions;

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2010 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -44,18 +42,12 @@ namespace Bind
IBind Generator { get; set; }
Settings Settings { get { return Generator.Settings; } }
#region ISpecWriter Members
public void WriteBindings(IBind generator)
{
Generator = generator;
WriteBindings(generator.Delegates, generator.Wrappers, generator.Enums);
}
#endregion
#region Private Members
private static void ConsoleRewrite(string text)
{
int left = Console.CursorLeft;
@ -67,8 +59,6 @@ namespace Bind
Console.SetCursorPosition(left, top);
}
#region WriteBindings
void WriteBindings(DelegateCollection delegates, FunctionCollection wrappers, EnumCollection enums)
{
Console.WriteLine("Writing bindings to {0}", Settings.OutputPath);
@ -143,10 +133,6 @@ namespace Bind
File.Move(temp_wrappers_file, output_wrappers);
}
#endregion
#region WriteWrappers
void WriteWrappers(BindStreamWriter sw, FunctionCollection wrappers,
DelegateCollection delegates, EnumCollection enums,
IDictionary<string, string> CSTypes)
@ -398,10 +384,6 @@ namespace Bind
}
}
#endregion
#region WriteTypes
public void WriteTypes(BindStreamWriter sw, Dictionary<string, string> CSTypes)
{
sw.WriteLine();
@ -411,10 +393,6 @@ namespace Bind
}
}
#endregion
#region WriteConstants
void WriteConstants(BindStreamWriter sw, IEnumerable<Constant> constants)
{
// Make sure everything is sorted. This will avoid random changes between
@ -439,10 +417,6 @@ namespace Bind
}
}
#endregion
#region WriteEnums
void WriteEnums(BindStreamWriter sw, EnumCollection enums, FunctionCollection wrappers)
{
//sw.WriteLine("#pragma warning disable 3019"); // CLSCompliant attribute
@ -548,18 +522,12 @@ namespace Bind
}
}
#endregion
#region WriteLicense
public void WriteLicense(BindStreamWriter sw)
{
sw.WriteLine(File.ReadAllText(Path.Combine(Settings.InputPath, Settings.LicenseFile)));
sw.WriteLine();
}
#endregion
// For example, if parameter foo has indirection level = 1, then it
// is consumed as 'foo*' in the fixed_statements and the call string.
readonly static string[] pointer_levels = new string[] { "", "*", "**", "***", "****" };
@ -757,7 +725,5 @@ namespace Bind
pointer_levels[type.Pointer],
array_levels[type.Array]);
}
#endregion
}
}

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2010 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -87,8 +85,6 @@ namespace Bind
return path.ToString();
}
#region Private Members
EnumCollection ProcessNames(EnumCollection enums, XPathNavigator nav, string apiname)
{
EnumCollection processed_enums = new EnumCollection();
@ -420,7 +416,5 @@ namespace Bind
}
return is_number;
}
#endregion
}
}

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2013 Stefanos Apostolopoulos for the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -141,8 +139,6 @@ namespace Bind
return wrappers;
}
#region Private Members
void GenerateDocumentation(FunctionCollection wrappers,
EnumProcessor enum_processor, DocProcessor doc_processor)
{
@ -1248,7 +1244,5 @@ namespace Bind
func.ReturnType.QualifiedType = "bool";
}
}
#endregion
}
}

View file

@ -1,4 +1,3 @@
#region License
//
// GL2Generator.cs
//
@ -25,7 +24,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#endregion
using System;
using System.IO;

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;

View file

@ -1,8 +1,6 @@
#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*/
#endregion
using System;
using System.Collections.Generic;
@ -20,8 +18,6 @@ namespace Bind.GL2
{
abstract class Generator : IBind
{
#region Fields
protected string glTypemap = "GL2/gl.tm";
protected string csTypemap = "csharp.tm";
protected string enumSpec = "GL2/enum.spec";
@ -56,10 +52,6 @@ namespace Bind.GL2
public Settings Settings { get; protected set; }
#endregion
#region Constructors
public Generator(Settings settings)
{
if (settings == null)
@ -86,10 +78,6 @@ namespace Bind.GL2
SpecReader = new XmlSpecReader(Settings);
}
#endregion
#region Private Members
IEnumerable<string> GetFiles(string path)
{
path = Path.Combine(Settings.InputPath, path);
@ -107,10 +95,6 @@ namespace Bind.GL2
}
}
#endregion
#region IBind Members
public DelegateCollection Delegates { get; private set; }
public EnumCollection Enums { get; private set; }
public FunctionCollection Wrappers { get; private set; }
@ -146,7 +130,5 @@ namespace Bind.GL2
Wrappers = func_processor.Process(enum_processor, doc_processor,
Delegates, Enums, Profile, Version);
}
#endregion
}
}

View file

@ -1,8 +1,6 @@
#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*/
#endregion
using Bind.Structures;
using System.Collections.Generic;

View file

@ -1,8 +1,6 @@
#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*/
#endregion
using System.Collections.Generic;
using System.IO;

View file

@ -1,8 +1,6 @@
#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*/
#endregion
using System;
using System.Collections.Generic;

View file

@ -1,8 +1,6 @@
#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*/
#endregion
using System;
using System.Collections.Generic;

View file

@ -1,8 +1,6 @@
#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*/
#endregion
using System;
using System.Diagnostics;
@ -19,8 +17,6 @@ namespace Bind.Structures
/// </summary>
class Constant : IComparable<Constant>
{
#region PreviousName
string original_name;
// Gets the name prior to translation.
@ -30,10 +26,6 @@ namespace Bind.Structures
private set { original_name = value; }
}
#endregion
#region public string Name
string _name;
/// <summary>
@ -55,10 +47,6 @@ namespace Bind.Structures
}
}
#endregion
#region public string Value
string _value;
/// <summary>
@ -79,10 +67,6 @@ namespace Bind.Structures
}
}
#endregion
#region public string Reference
string _reference;
/// <summary>
@ -98,10 +82,6 @@ namespace Bind.Structures
}
}
#endregion
#region public bool Unchecked
public bool Unchecked
{
get
@ -115,10 +95,6 @@ namespace Bind.Structures
}
}
#endregion
#region Constructors
/// <summary>
/// Creates an empty Constant.
/// </summary>
@ -137,8 +113,6 @@ namespace Bind.Structures
Value = value;
}
#endregion
/// <summary>
/// Replces the Value of the given constant with the value referenced by the [c.Reference, c.Value] pair.
/// </summary>
@ -192,8 +166,6 @@ namespace Bind.Structures
return true;
}
#region ToString
public override string ToString()
{
return
@ -204,10 +176,6 @@ namespace Bind.Structures
Value);
}
#endregion
#region IComparable <Constant>Members
public int CompareTo(Constant other)
{
int ret = Value.CompareTo(other.Value);
@ -215,7 +183,5 @@ namespace Bind.Structures
return Name.CompareTo(other.Name);
return ret;
}
#endregion
}
}

View file

@ -1,8 +1,6 @@
#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*/
#endregion
using System;
using System.Collections.Generic;
@ -33,8 +31,6 @@ namespace Bind.Structures
// The default Regex matches no functions. Create a new Regex in Bind.Generator classes to override the default behavior.
internal static Regex endingsAddV = new Regex("^0", RegexOptions.Compiled);
#region --- Constructors ---
public Delegate()
{
Parameters = new ParameterCollection();
@ -57,12 +53,6 @@ namespace Bind.Structures
Slot = d.Slot;
}
#endregion
#region --- Properties ---
#region public bool CLSCompliant
/// <summary>
/// Gets the CLSCompliant property. True if the delegate is not CLSCompliant.
/// </summary>
@ -92,10 +82,6 @@ namespace Bind.Structures
}
}
#endregion
#region public string Category
private string _category;
public string Category
@ -104,10 +90,6 @@ namespace Bind.Structures
set { _category = value; }
}
#endregion
#region public bool NeedsWrapper
/// <summary>
/// Gets a value that indicates whether this function needs to be wrapped with a Marshaling function.
/// This flag is set if a function contains an Array parameter, or returns
@ -132,10 +114,6 @@ namespace Bind.Structures
}
}
#endregion
#region public virtual bool Unsafe
/// <summary>
/// True if the delegate must be declared as 'unsafe'.
/// </summary>
@ -163,10 +141,6 @@ namespace Bind.Structures
}
}
#endregion
#region public Parameter ReturnType
Type _return_type = new Type();
/// <summary>
/// Gets or sets the return value of the opengl function.
@ -180,10 +154,6 @@ namespace Bind.Structures
}
}
#endregion
#region public virtual string Name
string _name;
/// <summary>
/// Gets or sets the name of the opengl function.
@ -200,10 +170,6 @@ namespace Bind.Structures
}
}
#endregion
#region public ParameterCollection Parameters
ParameterCollection _parameters;
public ParameterCollection Parameters
@ -212,10 +178,6 @@ namespace Bind.Structures
set { _parameters = value; }
}
#endregion
#region public string Version
string _version;
/// <summary>
@ -227,18 +189,12 @@ namespace Bind.Structures
set { _version = value; }
}
#endregion
#region public bool Extension
public string Extension
{
get;
set;
}
#endregion
public bool Deprecated { get; set; }
public string DeprecatedVersion { get; set; }
public string EntryPoint { get; set; }
@ -247,8 +203,6 @@ namespace Bind.Structures
// Slot index in the address table
public int Slot { get; set; }
#endregion
// This method should only be used for debugging purposes, not for code generation!
// Returns a string representing the full delegate declaration without decorations.
// (ie "(unsafe) void delegate glXxxYyy(int a, float b, IntPtr c)"
@ -266,8 +220,6 @@ namespace Bind.Structures
return sb.ToString();
}
#region IComparable<Delegate> Members
public int CompareTo(Delegate other)
{
int ret = Name.CompareTo(other.Name);
@ -278,10 +230,6 @@ namespace Bind.Structures
return ret;
}
#endregion
#region IEquatable<Delegate> Members
public bool Equals(Delegate other)
{
return
@ -289,12 +237,8 @@ namespace Bind.Structures
Parameters.Equals(other.Parameters) &&
ReturnType.Equals(other.ReturnType);
}
#endregion
}
#region DelegateCollection
class DelegateCollection : IDictionary<string, List<Delegate>>
{
readonly SortedDictionary<string, List<Delegate>> Delegates =
@ -348,8 +292,6 @@ namespace Bind.Structures
}
}
#region IDictionary Members
public void Add(string key, List<Delegate> value)
{
Delegates.Add(key, value.ToList());
@ -398,10 +340,6 @@ namespace Bind.Structures
}
}
#endregion
#region ICollection implementation
public void Add(KeyValuePair<string, List<Delegate>> item)
{
Delegates.Add(item.Key, item.Value.ToList());
@ -443,26 +381,14 @@ namespace Bind.Structures
}
}
#endregion
#region IEnumerable implementation
public IEnumerator<KeyValuePair<string, List<Delegate>>> GetEnumerator()
{
return Delegates.GetEnumerator();
}
#endregion
#region IEnumerable implementation
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return Delegates.GetEnumerator();
}
#endregion
}
#endregion
}

View file

@ -1,5 +1,4 @@
#region License
//
//
// Documentation.cs
//
// Author:
@ -25,7 +24,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;

View file

@ -1,8 +1,6 @@
#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*/
#endregion
using System;
using System.Collections.Generic;
@ -13,8 +11,6 @@ using System.Xml.XPath;
namespace Bind.Structures
{
#region class Enum
class Enum
{
string _name, _type;
@ -81,10 +77,6 @@ namespace Bind.Structures
public bool CLSCompliant { get; set; }
}
#endregion
#region class EnumCollection
class EnumCollection : IDictionary<string, Enum>
{
SortedDictionary<string, Enum> Enumerations = new SortedDictionary<string, Enum>();
@ -119,8 +111,6 @@ namespace Bind.Structures
return 0;
}
#region Public Members
public void Add(Enum e)
{
Add(e.Name, e);
@ -134,10 +124,6 @@ namespace Bind.Structures
}
}
#endregion
#region IDictionary<string, Enum> Members
public void Add(string key, Enum value)
{
if (ContainsKey(key))
@ -235,9 +221,5 @@ namespace Bind.Structures
{
return Enumerations.GetEnumerator();
}
#endregion
}
#endregion
}

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
namespace Bind.Structures
{

View file

@ -1,8 +1,6 @@
#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*/
#endregion
using System;
using System.Collections.Generic;
@ -14,14 +12,8 @@ namespace Bind.Structures
{
class Function : Delegate, IEquatable<Function>, IComparable<Function>
{
#region Fields
Delegate wrapped_delegate;
#endregion
#region --- Constructors ---
public Function(Delegate d)
: base(d)
{
@ -42,20 +34,12 @@ namespace Bind.Structures
Body.AddRange(f.Body);
}
#endregion
#region public Delegate WrappedDelegate
public Delegate WrappedDelegate
{
get { return wrapped_delegate; }
set { wrapped_delegate = value; }
}
#endregion
#region public void TurnVoidPointersToIntPtr()
public void TurnVoidPointersToIntPtr()
{
foreach (Parameter p in Parameters)
@ -68,10 +52,6 @@ namespace Bind.Structures
}
}
#endregion
#region public override bool Unsafe
public override bool Unsafe
{
get
@ -80,10 +60,6 @@ namespace Bind.Structures
}
}
#endregion
#region public FunctionBody Body
FunctionBody _body;
public FunctionBody Body
@ -92,22 +68,10 @@ namespace Bind.Structures
set { _body = value; }
}
#endregion
#region public string TrimmedName
public string TrimmedName { get; set; }
#endregion
#region Documentation
public Documentation Documentation { get; set; }
#endregion
#region ToString
public override string ToString()
{
return String.Format("{0} {1}{2}",
@ -116,10 +80,6 @@ namespace Bind.Structures
Parameters);
}
#endregion
#region IEquatable<Function> Members
public bool Equals(Function other)
{
bool result =
@ -129,10 +89,6 @@ namespace Bind.Structures
return result;
}
#endregion
#region IComparable<Function> Members
public int CompareTo(Function other)
{
int ret = Name.CompareTo(other.Name);
@ -142,12 +98,8 @@ namespace Bind.Structures
ret = ReturnType.CompareTo(other.ReturnType);
return ret;
}
#endregion
}
#region class FunctionBody : List<string>
public class FunctionBody : List<string>
{
public FunctionBody()
@ -208,10 +160,6 @@ namespace Bind.Structures
}
}
#endregion
#region class FunctionCollection : SortedDictionary<string, List<Function>>
class FunctionCollection : SortedDictionary<string, List<Function>>
{
Regex unsignedFunctions = new Regex(@".+(u[dfisb]v?)", RegexOptions.Compiled);
@ -276,6 +224,4 @@ namespace Bind.Structures
}
}
}
#endregion
}

View file

@ -1,8 +1,6 @@
#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*/
#endregion
using System;
using System.Collections.Generic;
@ -19,8 +17,6 @@ namespace Bind.Structures
{
string cache;
#region Constructors
/// <summary>
/// Creates a new Parameter without type and name.
/// </summary>
@ -49,10 +45,6 @@ namespace Bind.Structures
//this.rebuild = false;
}
#endregion
#region RawName
/// <summary>
/// Gets or sets the raw name of the parameter.
/// </summary>
@ -62,10 +54,6 @@ namespace Bind.Structures
private set;
}
#endregion
#region Name
/// <summary>
/// Gets the name of the parameter. If the name matches a keyword of the current language,
/// then it is escaped with <see cref="Settings.KeywordEscapeCharacter"/>.
@ -90,10 +78,6 @@ namespace Bind.Structures
}
}
#endregion
#region UnmanagedType
UnmanagedType _unmanaged_type;
/// <summary>
/// Gets or sets the name of the parameter.
@ -110,10 +94,6 @@ namespace Bind.Structures
}
}
#endregion
#region public FlowDirection Flow
FlowDirection _flow;
/// <summary>
@ -131,10 +111,6 @@ namespace Bind.Structures
}
}
#endregion
#region public bool NeedsPin
public bool NeedsPin
{
get
@ -144,10 +120,6 @@ namespace Bind.Structures
}
}
#endregion
#region public bool Unchecked
private bool _unchecked;
public bool Unchecked
@ -162,10 +134,6 @@ namespace Bind.Structures
}
}
#endregion
#region public bool Generic
bool generic;
public bool Generic
{
@ -173,10 +141,6 @@ namespace Bind.Structures
set { generic = value; }
}
#endregion
#region public bool DiffersOnlyOnReference
// Returns true if this parameter differs only on reference compared to another parameter, i.e:
// returns true for 'int' & 'ref int'
// returns true for 'ref float' & 'float'
@ -191,10 +155,6 @@ namespace Bind.Structures
other.Reference && !(Reference || Array > 0 || Pointer != 0));
}
#endregion
#region public string ComputeSize
string computeSize;
public string ComputeSize
{
@ -202,10 +162,6 @@ namespace Bind.Structures
set { computeSize = value; }
}
#endregion
#region Static Members
// Returns the FlowDirection that matches the specified string
// ("out" or "in", otherwise undefined).
public static FlowDirection GetFlowDirection(string direction)
@ -213,9 +169,6 @@ namespace Bind.Structures
return direction == "out" ? FlowDirection.Out : direction == "in" ? FlowDirection.In : FlowDirection.Undefined;
}
#endregion
#region IComparable<Parameter> Members
public int CompareTo(Parameter other)
{
@ -225,10 +178,6 @@ namespace Bind.Structures
return result;
}
#endregion
#region ToString
public override string ToString()
{
return String.Format("{2}{0} {1}",
@ -239,10 +188,6 @@ namespace Bind.Structures
String.Empty);
}
#endregion
#region IEquatable<Parameter> Members
public bool Equals(Parameter other)
{
bool result =
@ -251,8 +196,6 @@ namespace Bind.Structures
return result;
}
#endregion
}
/// <summary>
@ -270,8 +213,6 @@ namespace Bind.Structures
public bool Rebuild { get; set; }
Settings Settings { get; set; }
#region Constructors
public ParameterCollection()
{
}
@ -290,20 +231,12 @@ namespace Bind.Structures
Add(new Parameter(p));
}
#endregion
#region BuildCache
void BuildCache()
{
BuildReferenceAndPointerParametersCache();
Rebuild = false;
}
#endregion
#region public bool HasPointerParameters
public bool HasPointerParameters
{
get
@ -317,10 +250,6 @@ namespace Bind.Structures
}
}
#endregion
#region public bool HasReferenceParameters
public bool HasReferenceParameters
{
get
@ -334,10 +263,6 @@ namespace Bind.Structures
}
}
#endregion
#region public bool HasUnsignedParameters
public bool HasUnsignedParameters
{
get
@ -351,10 +276,6 @@ namespace Bind.Structures
}
}
#endregion
#region public bool HasGenericParameters
public bool HasGenericParameters
{
get
@ -368,9 +289,6 @@ namespace Bind.Structures
}
}
#endregion
#region void BuildReferenceAndPointerParametersCache()
void BuildReferenceAndPointerParametersCache()
{
@ -390,10 +308,6 @@ namespace Bind.Structures
}
}
#endregion
#region ToString
// Only use for debugging, not for code generation!
public override string ToString()
{
@ -414,10 +328,6 @@ namespace Bind.Structures
return sb.ToString();
}
#endregion
#region ContainsType
public bool ContainsType(string type)
{
foreach (Parameter p in this)
@ -426,10 +336,6 @@ namespace Bind.Structures
return false;
}
#endregion
#region IList<Parameter> Members
public void Add(Parameter p)
{
Parameters.Add(p);
@ -511,10 +417,6 @@ namespace Bind.Structures
}
}
#endregion
#region IComparable<ParameterCollection> Members
public int CompareTo(ParameterCollection other)
{
if (Count < other.Count)
@ -537,10 +439,6 @@ namespace Bind.Structures
}
}
#endregion
#region IEquatable<ParameterCollection> Members
public bool Equals(ParameterCollection other)
{
if (Count != other.Count)
@ -553,7 +451,5 @@ namespace Bind.Structures
}
return result;
}
#endregion
}
}

View file

@ -1,8 +1,6 @@
#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*/
#endregion
using System;
using System.Collections.Generic;
@ -17,8 +15,6 @@ namespace Bind.Structures
string current_qualifier = String.Empty;
string previous_qualifier = String.Empty;
#region --- Constructors ---
public Type()
{
}
@ -39,10 +35,6 @@ namespace Bind.Structures
}
}
#endregion
#region Private Members
string CurrentQualifier
{
get { return current_qualifier; }
@ -55,10 +47,6 @@ namespace Bind.Structures
set { previous_qualifier = value; }
}
#endregion
#region Public Members
public string QualifiedType
{
get
@ -87,8 +75,6 @@ namespace Bind.Structures
}
}
#region public string CurrentType
string type;
/// <summary>
/// Gets the type of the parameter.
@ -117,10 +103,6 @@ namespace Bind.Structures
}
}
#endregion
#region public string PreviousType
private string _previous_type;
public string PreviousType
@ -129,10 +111,6 @@ namespace Bind.Structures
private set { _previous_type = value; }
}
#endregion
#region public bool Reference
bool reference;
public bool Reference
@ -141,10 +119,6 @@ namespace Bind.Structures
set { reference = value; }
}
#endregion
#region public int Array
int array;
public int Array
@ -153,10 +127,6 @@ namespace Bind.Structures
set { array = value > 0 ? value : 0; }
}
#endregion
#region public int ElementCount
int element_count;
// If the type is an array and ElementCount > 0, then ElemenCount defines the expected array length.
@ -166,10 +136,6 @@ namespace Bind.Structures
set { element_count = value > 0 ? value : 0; }
}
#endregion
#region public int Pointer
int pointer;
public int Pointer
@ -178,12 +144,9 @@ namespace Bind.Structures
set { pointer = value > 0 ? value : 0; }
}
#endregion
// Set to true if parameter is an enum.
public bool IsEnum { get; set; }
#region public bool CLSCompliant
public bool CLSCompliant
{
@ -238,10 +201,6 @@ namespace Bind.Structures
}
}
#endregion
#region public bool Unsigned
public bool Unsigned
{
get
@ -250,10 +209,6 @@ namespace Bind.Structures
}
}
#endregion
#region public WrapperTypes WrapperType
private WrapperTypes _wrapper_type = WrapperTypes.None;
public WrapperTypes WrapperType
@ -262,10 +217,6 @@ namespace Bind.Structures
set { _wrapper_type = value; }
}
#endregion
#region public override string ToString()
static readonly string[] PointerLevels =
{
"",
@ -292,12 +243,6 @@ namespace Bind.Structures
ArrayLevels[Array]);
}
#endregion
#endregion
#region IComparable<Type> Members
public int CompareTo(Type other)
{
// Make sure that Pointer parameters are sorted last to avoid bug [#1098].
@ -322,10 +267,6 @@ namespace Bind.Structures
return result;
}
#endregion
#region IEquatable<Type> Members
public bool Equals(Type other)
{
bool result =
@ -341,7 +282,5 @@ namespace Bind.Structures
// redefinition errors in the generated bindings.
return result;
}
#endregion
}
}

View file

@ -1,8 +1,6 @@
#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*/
#endregion
using System;
using System.Collections.Generic;
@ -15,8 +13,6 @@ using Enum=Bind.Structures.Enum;
namespace Bind
{
#region WrapperTypes enum
[Flags]
public enum WrapperTypes
{
@ -96,8 +92,6 @@ namespace Bind
SizeParameter = 1 << 14,
}
#endregion
static class Utilities
{
public static readonly char[] Separators = { ' ', '\n', ',', '(', ')', ';', '#' };
@ -149,8 +143,6 @@ namespace Bind
}
}
#region internal StreamReader OpenSpecFile(string file)
internal static StreamReader OpenSpecFile(string folder, string file)
{
if (String.IsNullOrEmpty(folder) || String.IsNullOrEmpty(file))
@ -163,10 +155,6 @@ namespace Bind
return new StreamReader(path);
}
#endregion
#region Keywords
public static readonly List<string> CSharpKeywords = new List<string>(
new string[]
{
@ -193,10 +181,6 @@ namespace Bind
}
);
#endregion
#region Merge
// Merges the specified enum collections.
internal static void Merge(EnumCollection enums, EnumCollection new_enums)
{
@ -256,10 +240,6 @@ namespace Bind
return s;
}
#endregion
#region internal static string GetGL2Extension(string name)
internal static string GetGL2Extension(string name)
{
return GetExtension(name, false);
@ -286,26 +266,16 @@ namespace Bind
}
}
#endregion
#region private static bool IsGL2Extension(string function)
private static bool IsGL2Extension(string function)
{
return !String.IsNullOrEmpty(GetGL2Extension(function));
}
#endregion
#region internal static string StripGL2Extension(string p)
internal static string StripGL2Extension(string p)
{
return p.Substring(0, p.Length - GetGL2Extension(p).Length);
}
#endregion
public static bool RequiresSlot(this Delegate d, Settings settings)
{
double version;

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2013 Stefanos Apostolopoulos for the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -43,8 +41,6 @@ namespace Bind
{
Settings Settings { get; set; }
#region Constructors
public XmlSpecReader(Settings settings)
{
if (settings == null)
@ -52,10 +48,6 @@ namespace Bind
Settings = settings;
}
#endregion
#region ISpecReader Members
public void ReadDelegates(string file, DelegateCollection delegates, string apiname, string apiversions)
{
var specs = new XPathDocument(file);
@ -214,10 +206,6 @@ namespace Bind
}
}
#endregion
#region Private Members
static void GetSignaturePaths(string apiname, string apiversion, out string xpath_add, out string xpath_delete)
{
xpath_add = "/signatures/add";
@ -466,7 +454,5 @@ restart:
Utilities.Merge(enums, all);
return enums;
}
#endregion
}
}

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;

View file

@ -159,13 +159,10 @@ namespace Mono.Options
this.c = c;
}
#region ICollection
void ICollection.CopyTo (Array array, int index) {(values as ICollection).CopyTo (array, index);}
bool ICollection.IsSynchronized {get {return (values as ICollection).IsSynchronized;}}
object ICollection.SyncRoot {get {return (values as ICollection).SyncRoot;}}
#endregion
#region ICollection<T>
public void Add (string item) {values.Add (item);}
public void Clear () {values.Clear ();}
public bool Contains (string item) {return values.Contains (item);}
@ -173,17 +170,11 @@ namespace Mono.Options
public bool Remove (string item) {return values.Remove (item);}
public int Count {get {return values.Count;}}
public bool IsReadOnly {get {return false;}}
#endregion
#region IEnumerable
IEnumerator IEnumerable.GetEnumerator () {return values.GetEnumerator ();}
#endregion
#region IEnumerable<T>
public IEnumerator<string> GetEnumerator () {return values.GetEnumerator ();}
#endregion
#region IList
int IList.Add (object value) {return (values as IList).Add (value);}
bool IList.Contains (object value) {return (values as IList).Contains (value);}
int IList.IndexOf (object value) {return (values as IList).IndexOf (value);}
@ -192,9 +183,7 @@ namespace Mono.Options
void IList.RemoveAt (int index) {(values as IList).RemoveAt (index);}
bool IList.IsFixedSize {get {return false;}}
object IList.this [int index] {get {return this [index];} set {(values as IList)[index] = value;}}
#endregion
#region IList<T>
public int IndexOf (string item) {return values.IndexOf (item);}
public void Insert (int index, string item) {values.Insert (index, item);}
public void RemoveAt (int index) {values.RemoveAt (index);}
@ -221,7 +210,6 @@ namespace Mono.Options
values [index] = value;
}
}
#endregion
public List<string> ToList ()
{

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
// Created by Erik Ylvisaker on 3/17/08.
@ -344,7 +342,6 @@ namespace OpenTK.Platform.MacOS
/*
** Current state functions
*/
#region --- aglSetCurrentContext ---
[DllImport(agl,EntryPoint="aglSetCurrentContext")] static extern byte _aglSetCurrentContext(AGLContext ctx);
internal static bool aglSetCurrentContext(IntPtr context)
@ -357,8 +354,6 @@ namespace OpenTK.Platform.MacOS
return false;
}
#endregion
[DllImport(agl)] internal static extern AGLContext aglGetCurrentContext();

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
// Created by Erik Ylvisaker on 3/17/08.
@ -201,8 +199,6 @@ namespace OpenTK.Platform.MacOS
function, err, Agl.ErrorString(err)));
}
#region IGraphicsContext Members
bool firstSwap = true;
public void SwapBuffers()
{
@ -311,10 +307,6 @@ namespace OpenTK.Platform.MacOS
}
}
#endregion
#region IDisposable Members
~AglContext()
{
Dispose(false);
@ -363,10 +355,6 @@ namespace OpenTK.Platform.MacOS
disposed = true;
}
#endregion
#region IGraphicsContextInternal Members
public IntPtr GetAddress(string function)
{
return NS.GetAddress(function);
@ -392,7 +380,5 @@ namespace OpenTK.Platform.MacOS
return Handle;
}
}
#endregion
}
}

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -58,8 +56,6 @@ namespace OpenTK.Platform.MacOS
return GetGraphicsModeFromPixelFormat(pixelformat);
}
#region Internal Members
static bool RelaxGraphicsMode(ref ColorFormat color, ref int depth, ref int stencil, ref int samples, ref ColorFormat accum, ref int buffers, ref bool stereo)
{
// Parameters are relaxed in order of importance.
@ -224,7 +220,5 @@ namespace OpenTK.Platform.MacOS
IntPtr pixelformat = Agl.aglChoosePixelFormat(IntPtr.Zero, 0, attribs.ToArray());
return pixelformat;
}
#endregion
}
}

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -67,8 +65,6 @@ namespace OpenTK
return control.Location.Y;
}
#region IGLControl Members
public IGraphicsContext CreateContext(int major, int minor, GraphicsContextFlags flags)
{
// AGL does not support OpenGL profiles
@ -93,7 +89,5 @@ namespace OpenTK
return window_info;
}
}
#endregion
}
}

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library, except where noted.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using OpenTK.Graphics;
@ -33,8 +31,6 @@ namespace OpenTK
{
class DummyGLControl : IGLControl
{
#region IGLControl Members
public IGraphicsContext CreateContext(int major, int minor, GraphicsContextFlags flags)
{
return new DummyContext();
@ -50,10 +46,6 @@ namespace OpenTK
get { return Utilities.CreateDummyWindowInfo(); }
}
#endregion
#region class DummyContext
class DummyContext : IGraphicsContext, IGraphicsContextInternal
{
static int instance_count;
@ -65,8 +57,6 @@ namespace OpenTK
bool is_disposed;
int swap_interval;
#region IGraphicsContext Members
public void SwapBuffers()
{
}
@ -139,10 +129,6 @@ namespace OpenTK
is_disposed = true;
}
#endregion
#region IGraphicsContextInternal
public ContextHandle Context
{
get { return handle; }
@ -162,10 +148,6 @@ namespace OpenTK
{
get { return this; }
}
#endregion
}
#endregion
}
}

View file

@ -20,8 +20,6 @@
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
@ -39,7 +37,5 @@
this.ResumeLayout(false);
}
#endregion
}
}

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library, except where noted.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -64,8 +62,6 @@ namespace OpenTK
// evaluate this in the constructor.
readonly bool design_mode;
#region --- Constructors ---
/// <summary>
/// Constructs a new instance.
/// </summary>
@ -125,10 +121,6 @@ namespace OpenTK
InitializeComponent();
}
#endregion
#region --- Private Methods ---
IGLControl Implementation
{
get
@ -160,10 +152,6 @@ namespace OpenTK
RecreateHandle();
}
#endregion
#region --- Protected Methods ---
/// <summary>
/// Gets the <c>CreateParams</c> instance for this <c>GLControl</c>
/// </summary>
@ -309,12 +297,6 @@ namespace OpenTK
base.OnParentChanged(e);
}
#endregion
#region --- Public Methods ---
#region public void SwapBuffers()
/// <summary>
/// Swaps the front and back buffers, presenting the rendered scene to the screen.
/// This method will have no effect on a single-buffered <c>GraphicsMode</c>.
@ -325,10 +307,6 @@ namespace OpenTK
Context.SwapBuffers();
}
#endregion
#region public void MakeCurrent()
/// <summary>
/// <para>
/// Makes <see cref="GLControl.Context"/> current in the calling thread.
@ -350,10 +328,6 @@ namespace OpenTK
Context.MakeCurrent(Implementation.WindowInfo);
}
#endregion
#region public bool IsIdle
/// <summary>
/// Gets a value indicating whether the current thread contains pending system messages.
/// </summary>
@ -367,10 +341,6 @@ namespace OpenTK
}
}
#endregion
#region public IGraphicsContext Context
/// <summary>
/// Gets the <c>IGraphicsContext</c> instance that is associated with the <c>GLControl</c>.
/// The associated <c>IGraphicsContext</c> is updated whenever the <c>GLControl</c>
@ -390,10 +360,6 @@ namespace OpenTK
private set { context = value; }
}
#endregion
#region public float AspectRatio
/// <summary>
/// Gets the aspect ratio of this GLControl.
/// </summary>
@ -407,10 +373,6 @@ namespace OpenTK
}
}
#endregion
#region public bool VSync
/// <summary>
/// Gets or sets a value indicating whether vsync is active for this <c>GLControl</c>.
/// When using multiple <c>GLControl</c>s, ensure that <see cref="Context"/>
@ -451,10 +413,6 @@ namespace OpenTK
}
}
#endregion
#region public GraphicsMode GraphicsMode
/// <summary>
/// Gets the <c>GraphicsMode</c> of the <c>IGraphicsContext</c> associated with
/// this <c>GLControl</c>. If you wish to change <c>GraphicsMode</c>, you must
@ -469,10 +427,6 @@ namespace OpenTK
}
}
#endregion
#region WindowInfo
/// <summary>
/// Gets the <see cref="OpenTK.Platform.IWindowInfo"/> for this instance.
/// </summary>
@ -480,9 +434,5 @@ namespace OpenTK
{
get { return implementation.WindowInfo; }
}
#endregion
#endregion
}
}

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library, except where noted.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library, except where noted.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;

View file

@ -1,4 +1,3 @@
#region License
//
// NS.cs
//
@ -26,8 +25,6 @@
// THE SOFTWARE.
//
#endregion
using System;
using System.Runtime.InteropServices;

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2013 Stefanos Apostolopoulos
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library, except where noted.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -37,10 +35,6 @@ namespace OpenTK
{
class WinGLControl : IGLControl
{
#region P/Invoke declarations
#region Message
struct MSG
{
public IntPtr HWnd;
@ -57,10 +51,6 @@ namespace OpenTK
}
}
#endregion
#region Point
struct POINT
{
public int X;
@ -83,32 +73,14 @@ namespace OpenTK
}
}
#endregion
#region PeekMessage
[System.Security.SuppressUnmanagedCodeSecurity]
[System.Runtime.InteropServices.DllImport("User32.dll")]
static extern bool PeekMessage(ref MSG msg, IntPtr hWnd, int messageFilterMin, int messageFilterMax, int flags);
#endregion
#region
#endregion
#endregion
#region Fields
MSG msg = new MSG();
IWindowInfo window_info;
GraphicsMode mode;
#endregion
#region Constructors
public WinGLControl(GraphicsMode mode, Control control)
{
this.mode = mode;
@ -116,10 +88,6 @@ namespace OpenTK
window_info = Utilities.CreateWindowsWindowInfo(control.Handle);
}
#endregion
#region IGLControl Members
public IGraphicsContext CreateContext(int major, int minor, GraphicsContextFlags flags)
{
return new GraphicsContext(mode, window_info, major, minor, flags);
@ -138,7 +106,5 @@ namespace OpenTK
return window_info;
}
}
#endregion
}
}

View file

@ -1,10 +1,8 @@
#region --- License ---
/* Licensed under the MIT/X11 license.
/* Licensed under the MIT/X11 license.
* Copyright (c) 2006-2008 the OpenTK Team.
* This notice may not be removed from any source distribution.
* See license.txt for licensing detailed licensing details.
*/
#endregion
using System;
using System.Collections.Generic;
@ -19,8 +17,6 @@ namespace OpenTK
{
class X11GLControl : IGLControl
{
#region P/Invokes
[DllImport("libX11")]
static extern IntPtr XCreateColormap(IntPtr display, IntPtr window, IntPtr visual, int alloc);
@ -56,10 +52,6 @@ namespace OpenTK
}
}
#endregion
#region Fields
GraphicsMode mode;
IWindowInfo window_info;
IntPtr display;
@ -68,8 +60,6 @@ namespace OpenTK
// Use reflection to retrieve the necessary values from Mono's Windows.Forms implementation.
Type xplatui = Type.GetType("System.Windows.Forms.XplatUIX11, System.Windows.Forms");
#endregion
internal X11GLControl(GraphicsMode mode, Control control)
{
if (mode == null)
@ -105,8 +95,6 @@ namespace OpenTK
window_info = Utilities.CreateX11WindowInfo(display, screen, control.Handle, rootWindow, IntPtr.Zero);
}
#region IGLControl Members
public IGraphicsContext CreateContext(int major, int minor, GraphicsContextFlags flags)
{
GraphicsContext context = new GraphicsContext(mode, this.WindowInfo, major, minor, flags);
@ -141,10 +129,6 @@ namespace OpenTK
}
}
#endregion
#region Private Members
static object GetStaticFieldValue(Type type, string fieldName)
{
return type.GetField(fieldName,
@ -156,7 +140,5 @@ namespace OpenTK
type.GetField(fieldName,
System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).SetValue(null, value);
}
#endregion
}
}

View file

@ -19,24 +19,14 @@ namespace OpenTK
public class GLWidget: DrawingArea
{
#region Static attrs.
private static int _GraphicsContextCount;
private static bool _SharedContextInitialized = false;
#endregion
#region Attributes
private IGraphicsContext _GraphicsContext;
private IWindowInfo _WindowInfo;
private GraphicsContextFlags _GraphicsContextFlags;
private bool _Initialized = false;
#endregion
#region Properties
/// <summary>
/// Use a single buffer versus a double buffer.
/// </summary>
@ -98,10 +88,6 @@ namespace OpenTK
}
}
#endregion
#region Construction/Destruction
/// <summary>
/// Initializes a new instance of the <see cref="GLWidget"/> class.
/// </summary>
@ -204,10 +190,6 @@ namespace OpenTK
}
}
#endregion
#region New Events
/// <summary>
/// Called when the first <see cref="GraphicsContext"/> is created in the case where
/// GraphicsContext.ShareContexts == true;
@ -281,8 +263,6 @@ namespace OpenTK
ShuttingDown(this, EventArgs.Empty);
}
#endregion
#if GTK3
/// <summary>
/// Called when the widget needs to be (fully or partially) redrawn.

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -41,8 +39,6 @@ namespace OpenTK.Audio
/// </summary>
public sealed class AudioCapture : IDisposable
{
#region Fields
// This must stay private info so the end-user cannot call any Alc commands for the recording device.
IntPtr Handle;
@ -52,9 +48,6 @@ namespace OpenTK.Audio
ALFormat sample_format;
int sample_frequency;
#endregion
#region Constructors
static AudioCapture()
{
@ -120,12 +113,6 @@ namespace OpenTK.Audio
SampleFrequency = frequency;
}
#endregion Constructor
#region Public Members
#region CurrentDevice
private string device_name;
/// <summary>
@ -139,10 +126,6 @@ namespace OpenTK.Audio
}
}
#endregion
#region AvailableDevices
/// <summary>
/// Returns a list of strings containing all known recording devices.
/// </summary>
@ -154,10 +137,6 @@ namespace OpenTK.Audio
}
}
#endregion
#region DefaultDevice
/// <summary>
/// Returns the name of the device that will be used as recording default.
/// </summary>
@ -169,10 +148,6 @@ namespace OpenTK.Audio
}
}
#endregion
#region CheckErrors
/// <summary>
/// Checks for ALC error conditions.
/// </summary>
@ -185,10 +160,6 @@ namespace OpenTK.Audio
new AudioDeviceErrorChecker(Handle).Dispose();
}
#endregion
#region CurrentError
/// <summary>Returns the ALC error code for this device.</summary>
public AlcError CurrentError
{
@ -198,10 +169,6 @@ namespace OpenTK.Audio
}
}
#endregion
#region Start & Stop
/// <summary>
/// Start recording samples.
/// The number of available samples can be obtained through the <see cref="AvailableSamples"/> property.
@ -220,10 +187,6 @@ namespace OpenTK.Audio
_isrecording = false;
}
#endregion Start & Stop Capture
#region AvailableSamples
/// <summary>Returns the number of available samples for capture.</summary>
public int AvailableSamples
{
@ -237,10 +200,6 @@ namespace OpenTK.Audio
}
}
#endregion Available samples property
#region ReadSamples
/// <summary>Fills the specified buffer with samples from the internal capture ring-buffer. This method does not block: it is an error to specify a sampleCount larger than AvailableSamples.</summary>
/// <param name="buffer">A pointer to a previously initialized and pinned array.</param>
/// <param name="sampleCount">The number of samples to be written to the buffer.</param>
@ -274,10 +233,6 @@ namespace OpenTK.Audio
finally { buffer_ptr.Free(); }
}
#endregion
#region SampleFormat & SampleFrequency
/// <summary>
/// Gets the OpenTK.Audio.ALFormat for this instance.
/// </summary>
@ -296,10 +251,6 @@ namespace OpenTK.Audio
private set { sample_frequency = value; }
}
#endregion
#region IsRunning
/// <summary>
/// Gets a value indicating whether this instance is currently capturing samples.
/// </summary>
@ -308,12 +259,6 @@ namespace OpenTK.Audio
get { return _isrecording; }
}
#endregion
#endregion
#region Private Members
// Retrieves the sample size in bytes for various ALFormats.
// Compressed formats always return 1.
static int GetSampleSize(ALFormat format)
@ -374,10 +319,6 @@ namespace OpenTK.Audio
"\nBuffer Size: " + buffersize;
}
#endregion
#region IDisposable Members
/// <summary>
/// Finalizes this instance.
/// </summary>
@ -409,7 +350,5 @@ namespace OpenTK.Audio
this.IsDisposed = true;
}
}
#endregion Destructor
}
}

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
@ -41,8 +39,6 @@ namespace OpenTK.Audio
/// </summary>
public sealed class AudioContext : IDisposable
{
#region --- Fields ---
bool disposed;
bool is_processing, is_synchronized;
IntPtr device_handle;
@ -53,12 +49,6 @@ namespace OpenTK.Audio
static object audio_context_lock = new object();
static Dictionary<ContextHandle, AudioContext> available_contexts = new Dictionary<ContextHandle, AudioContext>();
#endregion
#region --- Constructors ---
#region static AudioContext()
/// \internal
/// <summary>
/// Runs before the actual class constructor, to load available devices.
@ -69,28 +59,16 @@ namespace OpenTK.Audio
{ }
}
#endregion static AudioContext()
#region public AudioContext()
/// <summary>Constructs a new AudioContext, using the default audio device.</summary>
public AudioContext()
: this(null, 0, 0, false, true, MaxAuxiliarySends.UseDriverDefault) { }
#endregion
#region public AudioContext(string device)
/// <summary>
/// Constructs a new AudioContext instance.
/// </summary>
/// <param name="device">The device name that will host this instance.</param>
public AudioContext(string device) : this(device, 0, 0, false, true, MaxAuxiliarySends.UseDriverDefault) { }
#endregion
#region public AudioContext(string device, int freq)
/// <summary>Constructs a new AudioContext, using the specified audio device and device parameters.</summary>
/// <param name="device">The name of the audio device to use.</param>
/// <param name="freq">Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.</param>
@ -100,10 +78,6 @@ namespace OpenTK.Audio
/// </remarks>
public AudioContext(string device, int freq) : this(device, freq, 0, false, true, MaxAuxiliarySends.UseDriverDefault) { }
#endregion
#region public AudioContext(string device, int freq, int refresh)
/// <summary>Constructs a new AudioContext, using the specified audio device and device parameters.</summary>
/// <param name="device">The name of the audio device to use.</param>
/// <param name="freq">Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.</param>
@ -115,10 +89,6 @@ namespace OpenTK.Audio
public AudioContext(string device, int freq, int refresh)
: this(device, freq, refresh, false, true, MaxAuxiliarySends.UseDriverDefault) { }
#endregion
#region public AudioContext(string device, int freq, int refresh, bool sync)
/// <summary>Constructs a new AudioContext, using the specified audio device and device parameters.</summary>
/// <param name="device">The name of the audio device to use.</param>
/// <param name="freq">Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.</param>
@ -131,10 +101,6 @@ namespace OpenTK.Audio
public AudioContext(string device, int freq, int refresh, bool sync)
: this(AudioDeviceEnumerator.AvailablePlaybackDevices[0], freq, refresh, sync, true) { }
#endregion
#region public AudioContext(string device, int freq, int refresh, bool sync, bool enableEfx)
/// <summary>Creates the audio context using the specified device and device parameters.</summary>
/// <param name="device">The device descriptor obtained through AudioContext.AvailableDevices.</param>
/// <param name="freq">Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.</param>
@ -165,10 +131,6 @@ namespace OpenTK.Audio
CreateContext(device, freq, refresh, sync, enableEfx, MaxAuxiliarySends.UseDriverDefault);
}
#endregion
#region public AudioContext(string device, int freq, int refresh, bool sync, bool enableEfx, MaxAuxiliarySends efxMaxAuxSends)
/// <summary>Creates the audio context using the specified device and device parameters.</summary>
/// <param name="device">The device descriptor obtained through AudioContext.AvailableDevices.</param>
/// <param name="freq">Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.</param>
@ -200,14 +162,6 @@ namespace OpenTK.Audio
CreateContext(device, freq, refresh, sync, enableEfx, efxMaxAuxSends);
}
#endregion
#endregion --- Constructors ---
#region --- Private Methods ---
#region CreateContext
/// <summary>May be passed at context construction time to indicate the number of desired auxiliary effect slot sends per source.</summary>
public enum MaxAuxiliarySends:int
{
@ -353,10 +307,6 @@ namespace OpenTK.Audio
}
}
#endregion --- Private Methods ---
#region static void MakeCurrent(AudioContext context)
/// \internal
/// <summary>Makes the specified AudioContext current in the calling thread.</summary>
/// <param name="context">The OpenTK.Audio.AudioContext to make current, or null.</param>
@ -377,10 +327,6 @@ namespace OpenTK.Audio
}
}
#endregion
#region internal bool IsCurrent
/// <summary>
/// Gets or sets a System.Boolean indicating whether the AudioContext
/// is current.
@ -410,20 +356,8 @@ namespace OpenTK.Audio
}
}
#endregion
#region IntPtr Device
IntPtr Device { get { return device_handle; } }
#endregion
#endregion
#region --- Public Members ---
#region CheckErrors
/// <summary>
/// Checks for ALC error conditions.
/// </summary>
@ -439,10 +373,6 @@ namespace OpenTK.Audio
new AudioDeviceErrorChecker(device_handle).Dispose();
}
#endregion
#region CurrentError
/// <summary>
/// Returns the ALC error code for this instance.
/// </summary>
@ -457,10 +387,6 @@ namespace OpenTK.Audio
}
}
#endregion
#region MakeCurrent
/// <summary>Makes the AudioContext current in the calling thread.</summary>
/// <exception cref="ObjectDisposedException">
/// Occurs if this function is called after the AudioContext has been disposed.
@ -480,10 +406,6 @@ namespace OpenTK.Audio
AudioContext.MakeCurrent(this);
}
#endregion
#region IsProcessing
/// <summary>
/// Gets a System.Boolean indicating whether the AudioContext is
/// currently processing audio events.
@ -502,10 +424,6 @@ namespace OpenTK.Audio
private set { is_processing = value; }
}
#endregion
#region IsSynchronized
/// <summary>
/// Gets a System.Boolean indicating whether the AudioContext is
/// synchronized.
@ -523,10 +441,6 @@ namespace OpenTK.Audio
private set { is_synchronized = value; }
}
#endregion
#region public void Process
/// <summary>
/// Processes queued audio events.
/// </summary>
@ -554,10 +468,6 @@ namespace OpenTK.Audio
IsProcessing = true;
}
#endregion
#region public void Suspend
/// <summary>
/// Suspends processing of audio events.
/// </summary>
@ -587,10 +497,6 @@ namespace OpenTK.Audio
IsProcessing = false;
}
#endregion
#region public bool SupportsExtension(string extension)
/// <summary>
/// Checks whether the specified OpenAL extension is supported.
/// </summary>
@ -604,10 +510,6 @@ namespace OpenTK.Audio
return Alc.IsExtensionPresent(this.Device, extension);
}
#endregion
#region CurrentDevice
/// <summary>
/// Gets a System.String with the name of the device used in this context.
/// </summary>
@ -622,14 +524,6 @@ namespace OpenTK.Audio
}
}
#endregion
#endregion --- Public Members ---
#region --- Static Members ---
#region public static AudioContext CurrentContext
/// <summary>
/// Gets the OpenTK.Audio.AudioContext which is current in the application.
/// </summary>
@ -657,10 +551,6 @@ namespace OpenTK.Audio
}
}
#endregion
#region AvailableDevices
/// <summary>
/// Returns a list of strings containing all known playback devices.
/// </summary>
@ -671,10 +561,6 @@ namespace OpenTK.Audio
return AudioDeviceEnumerator.AvailablePlaybackDevices;
}
}
#endregion public static IList<string> AvailablePlaybackDevices
#region DefaultDevice
/// <summary>
/// Returns the name of the device that will be used as playback default.
/// </summary>
@ -686,12 +572,6 @@ namespace OpenTK.Audio
}
}
#endregion
#endregion
#region --- IDisposable Members ---
/// <summary>
/// Disposes of the AudioContext, cleaning up all resources consumed by it.
/// </summary>
@ -732,10 +612,6 @@ namespace OpenTK.Audio
this.Dispose(false);
}
#endregion
#region --- Overrides ---
/// <summary>
/// Calculates the hash code for this instance.
/// </summary>
@ -764,7 +640,5 @@ namespace OpenTK.Audio
return String.Format("{0} (handle: {1}, device: {2})",
this.device_name, this.context_handle, this.device_handle);
}
#endregion
}
}

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -36,8 +34,6 @@ namespace OpenTK.Audio
{
internal static class AudioDeviceEnumerator
{
#region All device strings
private static readonly List<string> available_playback_devices = new List<string>();
private static readonly List<string> available_recording_devices = new List<string>();
@ -56,10 +52,6 @@ namespace OpenTK.Audio
}
}
#endregion All device strings
#region Default device strings
private static string default_playback_device;
internal static string DefaultPlaybackDevice
{
@ -78,10 +70,6 @@ namespace OpenTK.Audio
}
}
#endregion Default device strings
#region Is OpenAL supported?
private static bool openal_supported = true;
internal static bool IsOpenALSupported
{
@ -91,10 +79,6 @@ namespace OpenTK.Audio
}
}
#endregion Is OpenAL supported?
#region Alc Version number
internal enum AlcVersion
{
Alc1_0,
@ -110,10 +94,6 @@ namespace OpenTK.Audio
}
}
#endregion Alc Version number
#region Constructors
// Loads all available audio devices into the available_*_devices lists.
static AudioDeviceEnumerator()
{
@ -222,7 +202,5 @@ namespace OpenTK.Audio
}
}
}
#endregion
}
}

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -35,15 +33,9 @@ namespace OpenTK.Audio
{
struct AudioDeviceErrorChecker : IDisposable
{
#region Fields
readonly IntPtr Device;
static readonly string ErrorString = "Device {0} reported {1}.";
#endregion
#region Constructors
public AudioDeviceErrorChecker(IntPtr device)
{
if (device == IntPtr.Zero)
@ -52,10 +44,6 @@ namespace OpenTK.Audio
Device = device;
}
#endregion
#region IDisposable Members
public void Dispose()
{
AlcError err = Alc.GetError(Device);
@ -79,7 +67,5 @@ namespace OpenTK.Audio
break;
}
}
#endregion
}
}

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;

View file

@ -1,11 +1,9 @@
#region --- OpenTK.OpenAL License ---
/* AlFunctions.cs
/* AlFunctions.cs
* C header: \OpenAL 1.1 SDK\include\Al.h
* Spec: http://www.openal.org/openal_webstf/specs/OpenAL11Specification.pdf
* Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
* See license.txt for license details
* http://www.OpenTK.net */
#endregion
using System;
using System.Runtime.InteropServices;
@ -71,15 +69,9 @@ namespace OpenTK.Audio.OpenAL
public static partial class AL
{
#region Constants
internal const string Lib = "openal32.dll";
private const CallingConvention Style = CallingConvention.Cdecl;
#endregion Constants
#region Renderer State management
/// <summary>This function enables a feature of the OpenAL driver. There are no capabilities defined in OpenAL 1.1 to be used with this function, but it may be used by an extension.</summary>
/// <param name="capability">The name of a capability to enable.</param>
[DllImport(AL.Lib, EntryPoint = "alEnable", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
@ -99,10 +91,6 @@ namespace OpenTK.Audio.OpenAL
public static extern bool IsEnabled(ALCapability capability);
// AL_API ALboolean AL_APIENTRY alIsEnabled( ALenum capability );
#endregion Renderer State management
#region State retrieval
[DllImport(AL.Lib, EntryPoint = "alGetString", ExactSpelling = true, CallingConvention = AL.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
private static extern IntPtr GetStringPrivate(ALGetString param); // accepts the enums AlError, AlContextString
// AL_API const ALchar* AL_APIENTRY alGetString( ALenum param );
@ -168,10 +156,6 @@ namespace OpenTK.Audio.OpenAL
public static extern ALError GetError();
// AL_API ALenum AL_APIENTRY alGetError( void );
#endregion State retrieval
#region Extension support.
///<summary>This function tests if a specific Extension is available for the OpenAL driver.</summary>
/// <param name="extname">A string naming the desired extension. Example: "EAX-RAM"</param>
/// <returns>Returns True if the Extension is available or False if not available.</returns>
@ -193,8 +177,6 @@ namespace OpenTK.Audio.OpenAL
public static extern int GetEnumValue([In] string ename);
// AL_API ALenum AL_APIENTRY alGetEnumValue( const ALchar* ename );
#endregion Extension support.
/* Listener
* Listener represents the location and orientation of the
* 'user' in 3D-space.
@ -207,8 +189,6 @@ namespace OpenTK.Audio.OpenAL
* Orientation AL_ORIENTATION ALfloat[6] (Forward then Up vectors)
*/
#region Set Listener parameters
/// <summary>This function sets a floating-point property for the listener.</summary>
/// <param name="param">The name of the attribute to be set: ALListenerf.Gain</param>
/// <param name="value">The float value to set the attribute to.</param>
@ -281,10 +261,6 @@ namespace OpenTK.Audio.OpenAL
// AL_API void AL_APIENTRY alListener3i( ALenum param, ALint value1, ALint value2, ALint value3 );
// AL_API void AL_APIENTRY alListeneriv( ALenum param, const ALint* values );
#endregion Set Listener parameters
#region Get Listener parameters
/// <summary>This function retrieves a floating-point property of the listener.</summary>
/// <param name="param">the name of the attribute to be retrieved: ALListenerf.Gain</param>
/// <param name="value">a pointer to the floating-point value being retrieved.</param>
@ -345,8 +321,6 @@ namespace OpenTK.Audio.OpenAL
// AL_API void AL_APIENTRY alGetListener3i( ALenum param, ALint *value1, ALint *value2, ALint *value3 );
// AL_API void AL_APIENTRY alGetListeneriv( ALenum param, ALint* values );
#endregion Get Listener parameters
/* Source
* Sources represent individual sound objects in 3D-space.
* Sources take the PCM buffer provided in the specified Buffer,
@ -384,10 +358,6 @@ namespace OpenTK.Audio.OpenAL
* Buffers Processed (Query only) AL_BUFFERS_PROCESSED ALint
*/
#region Create Source objects
#region GenSources()
[DllImport(AL.Lib, EntryPoint = "alGenSources", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
unsafe private static extern void GenSourcesPrivate(int n, [Out] uint* sources);
// AL_API void AL_APIENTRY alGenSources( ALsizei n, ALuint* Sources );
@ -465,10 +435,6 @@ namespace OpenTK.Audio.OpenAL
GenSources(1, out source);
}
#endregion GenSources()
#region DeleteSources()
/// <summary>This function deletes one or more sources.</summary>
/// <param name="n">The number of sources to be deleted.</param>
/// <param name="sources">Pointer to an array of source names identifying the sources to be deleted.</param>
@ -524,10 +490,6 @@ namespace OpenTK.Audio.OpenAL
DeleteSources(1, ref source);
}
#endregion DeleteSources()
#region IsSource()
/// <summary>This function tests if a source name is valid, returning True if valid and False if not.</summary>
/// <param name="sid">A source name to be tested for validity</param>
/// <returns>Success.</returns>
@ -543,14 +505,6 @@ namespace OpenTK.Audio.OpenAL
return IsSource((uint)sid);
}
#endregion IsSource()
#endregion Create Source objects
#region Set Source parameters
#region Sourcef
/// <summary>This function sets a floating-point property of a source.</summary>
/// <param name="sid">Source name whose attribute is being set</param>
/// <param name="param">The name of the attribute to set: ALSourcef.Pitch, Gain, MinGain, MaxGain, MaxDistance, RolloffFactor, ConeOuterGain, ConeInnerAngle, ConeOuterAngle, ReferenceDistance, EfxAirAbsorptionFactor, EfxRoomRolloffFactor, EfxConeOuterGainHighFrequency.</param>
@ -568,10 +522,6 @@ namespace OpenTK.Audio.OpenAL
Source((uint)sid, param, value);
}
#endregion Sourcef
#region Source3f
/// <summary>This function sets a source property requiring three floating-point values.</summary>
/// <param name="sid">Source name whose attribute is being set.</param>
/// <param name="param">The name of the attribute to set: ALSource3f.Position, Velocity, Direction.</param>
@ -612,10 +562,6 @@ namespace OpenTK.Audio.OpenAL
Source((uint)sid, param, values.X, values.Y, values.Z);
}
#endregion Source3f
#region Sourcei
/// <summary>This function sets an integer property of a source.</summary>
/// <param name="sid">Source name whose attribute is being set.</param>
/// <param name="param">The name of the attribute to set: ALSourcei.SourceRelative, ConeInnerAngle, ConeOuterAngle, Looping, Buffer, SourceState.</param>
@ -669,10 +615,6 @@ namespace OpenTK.Audio.OpenAL
Source((uint)source, ALSourcei.Buffer, buffer);
}
#endregion Sourcei
#region Source3i
/// <summary>This function sets 3 integer properties of a source. This property is used to establish connections between Sources and Auxiliary Effect Slots.</summary>
/// <param name="sid">Source name whose attribute is being set.</param>
/// <param name="param">The name of the attribute to set: EfxAuxiliarySendFilter</param>
@ -694,18 +636,10 @@ namespace OpenTK.Audio.OpenAL
Source((uint)sid, param, value1, value2, value3);
}
#endregion Source3i
// Not used by any Enum:
// AL_API void AL_APIENTRY alSourcefv( ALuint sid, ALenum param, const ALfloat* values );
// AL_API void AL_APIENTRY alSourceiv( ALuint sid, ALenum param, const ALint* values );
#endregion Set Source parameters
#region Get Source parameters
#region GetSourcef
/// <summary>This function retrieves a floating-point property of a source.</summary>
/// <param name="sid">Source name whose attribute is being retrieved.</param>
/// <param name="param">The name of the attribute to set: ALSourcef.Pitch, Gain, MinGain, MaxGain, MaxDistance, RolloffFactor, ConeOuterGain, ConeInnerAngle, ConeOuterAngle, ReferenceDistance, EfxAirAbsorptionFactor, EfxRoomRolloffFactor, EfxConeOuterGainHighFrequency.</param>
@ -723,10 +657,6 @@ namespace OpenTK.Audio.OpenAL
GetSource((uint)sid, param, out value);
}
#endregion GetSourcef
#region GetSource3f
/// <summary>This function retrieves three floating-point values representing a property of a source.</summary>
/// <param name="sid">Source name whose attribute is being retrieved.</param>
/// <param name="param">the name of the attribute being retrieved: ALSource3f.Position, Velocity, Direction.</param>
@ -767,10 +697,6 @@ namespace OpenTK.Audio.OpenAL
GetSource((uint)sid, param, out values.X, out values.Y, out values.Z);
}
#endregion GetSource3f
#region GetSourcei
/// <summary>This function retrieves an integer property of a source.</summary>
/// <param name="sid">Source name whose attribute is being retrieved.</param>
/// <param name="param">The name of the attribute to retrieve: ALSourcei.SourceRelative, Buffer, SourceState, BuffersQueued, BuffersProcessed.</param>
@ -811,19 +737,11 @@ namespace OpenTK.Audio.OpenAL
value = result != 0;
}
#endregion GetSourcei
// Not used by any Enum:
// AL_API void AL_APIENTRY alGetSource3i( ALuint sid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
// AL_API void AL_APIENTRY alGetSourcefv( ALuint sid, ALenum param, ALfloat* values );
// AL_API void AL_APIENTRY alGetSourceiv( ALuint sid, ALenum param, ALint* values );
#endregion Get Source parameters
#region Source vector based playback calls
#region SourcePlay
/// <summary>This function plays a set of sources. The playing sources will have their state changed to ALSourceState.Playing. When called on a source which is already playing, the source will restart at the beginning. When the attached buffer(s) are done playing, the source will progress to the ALSourceState.Stopped state.</summary>
/// <param name="ns">The number of sources to be played.</param>
/// <param name="sids">A pointer to an array of sources to be played.</param>
@ -874,10 +792,6 @@ namespace OpenTK.Audio.OpenAL
}
}
#endregion SourcePlay
#region SourceStop
/// <summary>This function stops a set of sources. The stopped sources will have their state changed to ALSourceState.Stopped.</summary>
/// <param name="ns">The number of sources to stop.</param>
/// <param name="sids">A pointer to an array of sources to be stopped.</param>
@ -928,10 +842,6 @@ namespace OpenTK.Audio.OpenAL
}
}
#endregion SourceStop
#region SourceRewind
/// <summary>This function stops a set of sources and sets all their states to ALSourceState.Initial.</summary>
/// <param name="ns">The number of sources to be rewound.</param>
/// <param name="sids">A pointer to an array of sources to be rewound.</param>
@ -982,10 +892,6 @@ namespace OpenTK.Audio.OpenAL
}
}
#endregion SourceRewind
#region SourcePause
/// <summary>This function pauses a set of sources. The paused sources will have their state changed to ALSourceState.Paused.</summary>
/// <param name="ns">The number of sources to be paused.</param>
/// <param name="sids">A pointer to an array of sources to be paused.</param>
@ -1035,14 +941,6 @@ namespace OpenTK.Audio.OpenAL
}
}
#endregion SourcePause
#endregion Source vector based playback calls
#region Source based playback calls
#region SourcePlay
/// <summary>This function plays, replays or resumes a source. The playing source will have it's state changed to ALSourceState.Playing. When called on a source which is already playing, the source will restart at the beginning. When the attached buffer(s) are done playing, the source will progress to the ALSourceState.Stopped state.</summary>
/// <param name="sid">The name of the source to be played.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSourcePlay", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
@ -1056,10 +954,6 @@ namespace OpenTK.Audio.OpenAL
SourcePlay((uint)sid);
}
#endregion SourcePlay
#region SourceStop
/// <summary>This function stops a source. The stopped source will have it's state changed to ALSourceState.Stopped.</summary>
/// <param name="sid">The name of the source to be stopped.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSourceStop", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
@ -1073,10 +967,6 @@ namespace OpenTK.Audio.OpenAL
SourceStop((uint)sid);
}
#endregion SourceStop
#region SourceRewind
/// <summary>This function stops the source and sets its state to ALSourceState.Initial.</summary>
/// <param name="sid">The name of the source to be rewound.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSourceRewind", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
@ -1090,10 +980,6 @@ namespace OpenTK.Audio.OpenAL
SourceRewind((uint)sid);
}
#endregion SourceRewind
#region SourcePause
/// <summary>This function pauses a source. The paused source will have its state changed to ALSourceState.Paused.</summary>
/// <param name="sid">The name of the source to be paused.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSourcePause", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
@ -1107,14 +993,6 @@ namespace OpenTK.Audio.OpenAL
SourcePause((uint)sid);
}
#endregion SourcePause
#endregion Source based playback calls
#region Source Queuing
#region SourceQueueBuffers
/// <summary>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.</summary>
/// <param name="sid">The name of the source to queue buffers onto.</param>
/// <param name="numEntries">The number of buffers to be queued.</param>
@ -1177,10 +1055,6 @@ namespace OpenTK.Audio.OpenAL
unsafe { AL.SourceQueueBuffers((uint)source, 1, (uint*)&buffer); }
}
#endregion SourceQueueBuffers
#region SourceUnqueueBuffers
/// <summary>This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed, which is the maximum number of buffers that can be unqueued using this call. The unqueue operation will only take place if all n buffers can be removed from the queue.</summary>
/// <param name="sid">The name of the source to unqueue buffers from.</param>
/// <param name="numEntries">The number of buffers to be unqueued.</param>
@ -1239,10 +1113,6 @@ namespace OpenTK.Audio.OpenAL
return buf;
}
#endregion SourceUnqueueBuffers
#endregion Source Queuing
/*
* Buffer
* Buffer objects are storage space for sample buffer.
@ -1257,10 +1127,6 @@ namespace OpenTK.Audio.OpenAL
* Channels (Query only) AL_CHANNELS ALint
*/
#region Buffer objects
#region GenBuffers
/// <summary>This function generates one or more buffers, which contain audio buffer (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).</summary>
/// <param name="n">The number of buffers to be generated.</param>
/// <param name="buffers">Pointer to an array of uint values which will store the names of the new buffers.</param>
@ -1332,10 +1198,6 @@ namespace OpenTK.Audio.OpenAL
GenBuffers(1, out buffer);
}
#endregion GenBuffers
#region DeleteBuffers
/// <summary>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.</summary>
/// <param name="n">The number of buffers to be deleted.</param>
/// <param name="buffers">Pointer to an array of buffer names identifying the buffers to be deleted.</param>
@ -1414,10 +1276,6 @@ namespace OpenTK.Audio.OpenAL
DeleteBuffers(1, ref buffer);
}
#endregion DeleteBuffers
#region IsBuffer
/// <summary>This function tests if a buffer name is valid, returning True if valid, False if not.</summary>
/// <param name="bid">A buffer Handle previously allocated with <see cref="GenBuffers(int)"/>.</param>
/// <returns>Success.</returns>
@ -1434,10 +1292,6 @@ namespace OpenTK.Audio.OpenAL
return IsBuffer(temp);
}
#endregion IsBuffer
#region BufferData
/// <summary>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.</summary>
/// <param name="bid">buffer Handle/Name to be filled with buffer.</param>
/// <param name="format">Format type from among the following: ALFormat.Mono8, ALFormat.Mono16, ALFormat.Stereo8, ALFormat.Stereo16.</param>
@ -1476,12 +1330,6 @@ namespace OpenTK.Audio.OpenAL
finally { handle.Free(); }
}
#endregion BufferData
#endregion Buffer objects
#region Set Buffer parameters (currently parameters can only be read)
/*
Remarks (from Manual)
* There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by this call,
@ -1504,12 +1352,6 @@ namespace OpenTK.Audio.OpenAL
Buffer3f( bid, param, values.X, values.Y, values.Z );
}*/
#endregion Set Buffer parameters
#region Get Buffer parameters
#region GetBufferi
/// <summary>This function retrieves an integer property of a buffer.</summary>
/// <param name="bid">Buffer name whose attribute is being retrieved</param>
/// <param name="param">The name of the attribute to be retrieved: ALGetBufferi.Frequency, Bits, Channels, Size, and the currently hidden AL_DATA (dangerous).</param>
@ -1527,18 +1369,12 @@ namespace OpenTK.Audio.OpenAL
GetBuffer((uint)bid, param, out value);
}
#endregion GetBufferi
// AL_API void AL_APIENTRY alGetBufferf( ALuint bid, ALenum param, ALfloat* value );
// AL_API void AL_APIENTRY alGetBuffer3f( ALuint bid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
// AL_API void AL_APIENTRY alGetBufferfv( ALuint bid, ALenum param, ALfloat* values );
// AL_API void AL_APIENTRY alGetBuffer3i( ALuint bid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
// AL_API void AL_APIENTRY alGetBufferiv( ALuint bid, ALenum param, ALint* values );
#endregion Get Buffer parameters
#region Global Parameters
/// <summary>AL.DopplerFactor is a simple scaling of source and listener velocities to exaggerate or deemphasize the Doppler (pitch) shift resulting from the calculation.</summary>
/// <param name="value">A negative value will result in an error, the command is then ignored. The default value is 1f. The current setting can be queried using AL.Get with parameter ALGetFloat.SpeedOfSound.</param>
[DllImport(AL.Lib, EntryPoint = "alDopplerFactor", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
@ -1592,10 +1428,6 @@ namespace OpenTK.Audio.OpenAL
public static extern void DistanceModel(ALDistanceModel distancemodel);
// AL_API void AL_APIENTRY alDistanceModel( ALenum distanceModel );
#endregion Global Parameters
#region Helpers
/// <summary>(Helper) Returns Source state information.</summary>
/// <param name="sid">The source to be queried.</param>
/// <returns>state information from OpenAL.</returns>
@ -1646,7 +1478,5 @@ namespace OpenTK.Audio.OpenAL
{
return (ALDistanceModel)AL.Get(ALGetInteger.DistanceModel);
}
#endregion Helpers
}
}

View file

@ -1,11 +1,9 @@
#region --- OpenTK.OpenAL License ---
/* AlTokens.cs
/* AlTokens.cs
* C header: \OpenAL 1.1 SDK\include\Al.h
* Spec: http://www.openal.org/openal_webstf/specs/OpenAL11Specification.pdf
* Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
* See license.txt for license details
* http://www.OpenTK.net */
#endregion
using System;

View file

@ -1,11 +1,9 @@
#region --- OpenTK.OpenAL License ---
/* EfxFunctions.cs
/* EfxFunctions.cs
* C headers: \OpenAL 1.1 SDK\include\ "efx.h", "efx-creative.h", "Efx-Util.h"
* Spec: Effects Extension Guide.pdf (bundled with OpenAL SDK)
* Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
* See license.txt for license details
* http://www.OpenTK.net */
#endregion
using System;
using System.Diagnostics;
@ -19,10 +17,6 @@ namespace OpenTK.Audio.OpenAL
/// </summary>
public partial class EffectsExtension
{
#region Helpers
#region BindEffect
/// <summary>(Helper) Selects the Effect type used by this Effect handle.</summary>
/// <param name="eid">Effect id returned from a successful call to GenEffects.</param>
/// <param name="type">Effect type.</param>
@ -41,10 +35,6 @@ namespace OpenTK.Audio.OpenAL
Imported_alEffecti((uint)eid, EfxEffecti.EffectType, (int)type);
}
#endregion BindEffect
#region BindFilterToSource
/// <summary>(Helper) reroutes the output of a Source through a Filter.</summary>
/// <param name="source">A valid Source handle.</param>
/// <param name="filter">A valid Filter handle.</param>
@ -63,10 +53,6 @@ namespace OpenTK.Audio.OpenAL
AL.Source((uint)source, ALSourcei.EfxDirectFilter, (int)filter);
}
#endregion BindFilterToSource
#region BindEffectToAuxiliarySlot
/// <summary>(Helper) Attaches an Effect to an Auxiliary Effect Slot.</summary>
/// <param name="auxiliaryeffectslot">The slot handle to attach the Effect to.</param>
/// <param name="effect">The Effect handle that is being attached.</param>
@ -85,10 +71,6 @@ namespace OpenTK.Audio.OpenAL
AuxiliaryEffectSlot((uint)auxiliaryeffectslot, EfxAuxiliaryi.EffectslotEffect, (int)effect);
}
#endregion BindEffectToAuxiliarySlot
#region BindSourceToAuxiliarySlot
/// <summary>(Helper) Reroutes a Source's output into an Auxiliary Effect Slot.</summary>
/// <param name="source">The Source handle who's output is forwarded.</param>
/// <param name="slot">The Auxiliary Effect Slot handle that receives input from the Source.</param>
@ -111,14 +93,6 @@ namespace OpenTK.Audio.OpenAL
AL.Source((uint)source, ALSource3i.EfxAuxiliarySendFilter, (int)slot, (int)slotnumber, (int)filter);
}
#endregion BindSourceToAuxiliarySlot
#endregion Helpers
#region Effect Object
#region alGenEffects
//[CLSCompliant(false)]
unsafe private delegate void Delegate_alGenEffects(int n, [Out] uint* effects);
// typedef void (__cdecl *LPALGENEFFECTS)( ALsizei n, ALuint* effects );
@ -202,10 +176,6 @@ namespace OpenTK.Audio.OpenAL
}
#endregion alGenEffects
#region alDeleteEffects
//[CLSCompliant(false)]
unsafe private delegate void Delegate_alDeleteEffects(int n, [In] uint* effects);
// typedef void (__cdecl *LPALDELETEEFFECTS)( ALsizei n, ALuint* effects );
@ -280,10 +250,6 @@ namespace OpenTK.Audio.OpenAL
}
}
#endregion alDeleteEffects
#region alIsEffect
//[CLSCompliant(false)]
private delegate bool Delegate_alIsEffect(uint eid);
// typedef ALboolean (__cdecl *LPALISEFFECT)( ALuint eid );
@ -309,10 +275,6 @@ namespace OpenTK.Audio.OpenAL
return Imported_alIsEffect((uint)eid);
}
#endregion alIsEffect
#region alEffecti
//[CLSCompliant(false)]
private delegate void Delegate_alEffecti(uint eid, EfxEffecti param, int value);
// typedef void (__cdecl *LPALEFFECTI)( ALuint eid, ALenum param, ALint value);
@ -340,10 +302,6 @@ namespace OpenTK.Audio.OpenAL
Imported_alEffecti((uint)eid, param, value);
}
#endregion alEffecti
#region alEffectf
//[CLSCompliant(false)]
private delegate void Delegate_alEffectf(uint eid, EfxEffectf param, float value);
// typedef void (__cdecl *LPALEFFECTF)( ALuint eid, ALenum param, ALfloat value);
@ -371,10 +329,6 @@ namespace OpenTK.Audio.OpenAL
Imported_alEffectf((uint)eid, param, value);
}
#endregion alEffectf
#region alEffectfv
//[CLSCompliant(false)]
unsafe private delegate void Delegate_alEffectfv(uint eid, EfxEffect3f param, [In] float* values);
// typedef void (__cdecl *LPALEFFECTFV)( ALuint eid, ALenum param, ALfloat* values );
@ -408,10 +362,6 @@ namespace OpenTK.Audio.OpenAL
Effect((uint)eid, param, ref values);
}
#endregion alEffectfv
#region alGetEffecti
//[CLSCompliant(false)]
unsafe private delegate void Delegate_alGetEffecti(uint eid, EfxEffecti pname, [Out] int* value);
// typedef void (__cdecl *LPALGETEFFECTI)( ALuint eid, ALenum pname, ALint* value );
@ -445,10 +395,6 @@ namespace OpenTK.Audio.OpenAL
GetEffect((uint)eid, pname, out value);
}
#endregion alGetEffecti
#region alGetEffectf
//[CLSCompliant(false)]
unsafe private delegate void Delegate_alGetEffectf(uint eid, EfxEffectf pname, [Out]float* value);
// typedef void (__cdecl *LPALGETEFFECTF)( ALuint eid, ALenum pname, ALfloat* value );
@ -482,10 +428,6 @@ namespace OpenTK.Audio.OpenAL
GetEffect((uint)eid, pname, out value);
}
#endregion alGetEffectf
#region alGetEffectfv
//[CLSCompliant(false)]
unsafe private delegate void Delegate_alGetEffectfv(uint eid, EfxEffect3f param, [Out] float* values);
// typedef void (__cdecl *LPALGETEFFECTFV)( ALuint eid, ALenum pname, ALfloat* values );
@ -522,18 +464,10 @@ namespace OpenTK.Audio.OpenAL
GetEffect((uint)eid, param, out values);
}
#endregion alGetEffectfv
// Not used:
// typedef void (__cdecl *LPALEFFECTIV)( ALuint eid, ALenum param, ALint* values );
// typedef void (__cdecl *LPALGETEFFECTIV)( ALuint eid, ALenum pname, ALint* values );
#endregion Effect Object
#region Filter Object
#region alGenFilters
//[CLSCompliant(false)]
unsafe private delegate void Delegate_alGenFilters(int n, [Out] uint* filters);
// typedef void (__cdecl *LPALGENFILTERS)( ALsizei n, ALuint* filters );
@ -612,10 +546,6 @@ namespace OpenTK.Audio.OpenAL
}
}
#endregion alGenFilters
#region alDeleteFilters
//[CLSCompliant(false)]
unsafe private delegate void Delegate_alDeleteFilters(int n, [In] uint* filters);
// typedef void (__cdecl *LPALDELETEFILTERS)( ALsizei n, ALuint* filters );
@ -690,10 +620,6 @@ namespace OpenTK.Audio.OpenAL
}
}
#endregion alDeleteFilters
#region alIsFilter
//[CLSCompliant(false)]
private delegate bool Delegate_alIsFilter(uint fid);
// typedef ALboolean (__cdecl *LPALISFILTER)( ALuint fid );
@ -719,10 +645,6 @@ namespace OpenTK.Audio.OpenAL
return Imported_alIsFilter((uint)fid);
}
#endregion alIsFilter
#region alFilteri
//[CLSCompliant(false)]
private delegate void Delegate_alFilteri(uint fid, EfxFilteri param, int value);
// typedef void (__cdecl *LPALFILTERI)( ALuint fid, ALenum param, ALint value );
@ -750,10 +672,6 @@ namespace OpenTK.Audio.OpenAL
Imported_alFilteri((uint)fid, param, value);
}
#endregion alFilteri
#region alFilterf
//[CLSCompliant(false)]
private delegate void Delegate_alFilterf(uint fid, EfxFilterf param, float value);
// typedef void (__cdecl *LPALFILTERF)( ALuint fid, ALenum param, ALfloat value);
@ -781,10 +699,6 @@ namespace OpenTK.Audio.OpenAL
Imported_alFilterf((uint)fid, param, value);
}
#endregion alFilterf
#region alGetFilteri
//[CLSCompliant(false)]
unsafe private delegate void Delegate_alGetFilteri(uint fid, EfxFilteri pname, [Out] int* value);
// typedef void (__cdecl *LPALGETFILTERI)( ALuint fid, ALenum pname, ALint* value );
@ -818,10 +732,6 @@ namespace OpenTK.Audio.OpenAL
GetFilter((uint)fid, pname, out value);
}
#endregion alGetFilteri
#region alGetFilterf
//[CLSCompliant(false)]
unsafe private delegate void Delegate_alGetFilterf(uint fid, EfxFilterf pname, [Out] float* value);
// typedef void (__cdecl *LPALGETFILTERF)( ALuint fid, ALenum pname, ALfloat* value );
@ -855,20 +765,12 @@ namespace OpenTK.Audio.OpenAL
GetFilter((uint)fid, pname, out value);
}
#endregion alGetFilterf
// Not used:
// typedef void (__cdecl *LPALFILTERIV)( ALuint fid, ALenum param, ALint* values );
// typedef void (__cdecl *LPALFILTERFV)( ALuint fid, ALenum param, ALfloat* values );
// typedef void (__cdecl *LPALGETFILTERIV)( ALuint fid, ALenum pname, ALint* values );
// typedef void (__cdecl *LPALGETFILTERFV)( ALuint fid, ALenum pname, ALfloat* values );
#endregion Filter Object
#region Auxiliary Effect Slot Object
#region alGenAuxiliaryEffectSlots
//[CLSCompliant(false)]
unsafe private delegate void Delegate_alGenAuxiliaryEffectSlots(int n, [Out] uint* slots);
// typedef void (__cdecl *LPALGENAUXILIARYEFFECTSLOTS)( ALsizei n, ALuint* slots );
@ -945,10 +847,6 @@ namespace OpenTK.Audio.OpenAL
}
}
#endregion alGenAuxiliaryEffectSlots
#region DeleteAuxiliaryEffectSlots
unsafe private delegate void Delegate_alDeleteAuxiliaryEffectSlots(int n, [In] uint* slots);
// typedef void (__cdecl *LPALDELETEAUXILIARYEFFECTSLOTS)( ALsizei n, ALuint* slots );
@ -1021,10 +919,6 @@ namespace OpenTK.Audio.OpenAL
}
}
#endregion alDeleteAuxiliaryEffectSlots
#region alIsAuxiliaryEffectSlot
//[CLSCompliant(false)]
private delegate bool Delegate_alIsAuxiliaryEffectSlot(uint slot);
// typedef ALboolean (__cdecl *LPALISAUXILIARYEFFECTSLOT)( ALuint slot );
@ -1050,10 +944,6 @@ namespace OpenTK.Audio.OpenAL
return Imported_alIsAuxiliaryEffectSlot((uint)slot);
}
#endregion alIsAuxiliaryEffectSlot
#region alAuxiliaryEffectSloti
//[CLSCompliant(false)]
private delegate void Delegate_alAuxiliaryEffectSloti(uint asid, EfxAuxiliaryi param, int value);
// typedef void (__cdecl *LPALAUXILIARYEFFECTSLOTI)( ALuint asid, ALenum param, ALint value );
@ -1081,10 +971,6 @@ namespace OpenTK.Audio.OpenAL
Imported_alAuxiliaryEffectSloti((uint)asid, param, value);
}
#endregion alAuxiliaryEffectSloti
#region alAuxiliaryEffectSlotf
//[CLSCompliant(false)]
private delegate void Delegate_alAuxiliaryEffectSlotf(uint asid, EfxAuxiliaryf param, float value);
// typedef void (__cdecl *LPALAUXILIARYEFFECTSLOTF)( ALuint asid, ALenum param, ALfloat value );
@ -1112,10 +998,6 @@ namespace OpenTK.Audio.OpenAL
Imported_alAuxiliaryEffectSlotf((uint)asid, param, value);
}
#endregion alAuxiliaryEffectSlotf
#region alGetAuxiliaryEffectSloti
//[CLSCompliant(false)]
unsafe private delegate void Delegate_alGetAuxiliaryEffectSloti(uint asid, EfxAuxiliaryi pname, [Out] int* value);
// typedef void (__cdecl *LPALGETAUXILIARYEFFECTSLOTI)( ALuint asid, ALenum pname, ALint* value );
@ -1149,10 +1031,6 @@ namespace OpenTK.Audio.OpenAL
GetAuxiliaryEffectSlot((uint)asid, pname, out value);
}
#endregion alGetAuxiliaryEffectSloti
#region alGetAuxiliaryEffectSlotf
//[CLSCompliant(false)]
unsafe private delegate void Delegate_alGetAuxiliaryEffectSlotf(uint asid, EfxAuxiliaryf pname, [Out] float* value);
// typedef void (__cdecl *LPALGETAUXILIARYEFFECTSLOTF)( ALuint asid, ALenum pname, ALfloat* value );
@ -1186,18 +1064,12 @@ namespace OpenTK.Audio.OpenAL
GetAuxiliaryEffectSlot((uint)asid, pname, out value);
}
#endregion alGetAuxiliaryEffectSlotf
// Not used:
// typedef void (__cdecl *LPALAUXILIARYEFFECTSLOTIV)( ALuint asid, ALenum param, ALint* values );
// typedef void (__cdecl *LPALAUXILIARYEFFECTSLOTFV)( ALuint asid, ALenum param, ALfloat* values );
// typedef void (__cdecl *LPALGETAUXILIARYEFFECTSLOTIV)( ALuint asid, ALenum pname, ALint* values );
// typedef void (__cdecl *LPALGETAUXILIARYEFFECTSLOTFV)( ALuint asid, ALenum pname, ALfloat* values );
#endregion Auxiliary Effect Slot Object
#region Constructor / Extension Loading
private bool _valid;
/// <summary>Returns True if the EFX Extension has been found and could be initialized.</summary>
@ -1282,7 +1154,5 @@ namespace OpenTK.Audio.OpenAL
// didn't return so far, everything went fine.
_valid = true;
}
#endregion Constructor / Extension Loading
}
}

View file

@ -1,18 +1,14 @@
#region --- OpenTK.OpenAL License ---
/* EfxTokens.cs
/* EfxTokens.cs
* C headers: \OpenAL 1.1 SDK\include\ "efx.h", "efx-creative.h", "Efx-Util.h"
* Spec: Effects Extension Guide.pdf (bundled with OpenAL SDK)
* Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
* See license.txt for license details
* http://www.OpenTK.net */
#endregion
using System;
namespace OpenTK.Audio.OpenAL
{
#region Effect
///<summary>A list of valid 32-bit Float Effect/GetEffect parameters</summary>
public enum EfxEffectf : int
{
@ -410,10 +406,6 @@ namespace OpenTK.Audio.OpenAL
EaxReverb = 0x8000,
}
#endregion Effect
#region Auxiliary Effect Slot
///<summary>A list of valid Int32 AuxiliaryEffectSlot/GetAuxiliaryEffectSlot parameters</summary>
public enum EfxAuxiliaryi : int
{
@ -431,10 +423,6 @@ namespace OpenTK.Audio.OpenAL
EffectslotGain = 0x0002,
}
#endregion Auxiliary Effect Slot
#region Filter Object
///<summary>A list of valid 32-bits Float Filter/GetFilter parameters</summary>
public enum EfxFilterf : int
{
@ -475,6 +463,4 @@ namespace OpenTK.Audio.OpenAL
///<summary>Currently not implemented. A band-pass filter is used to remove high and low frequency content from a signal.</summary>
Bandpass = 0x0003,
}
#endregion Filter Object
}

View file

@ -1,11 +1,9 @@
#region --- OpenTK.OpenAL License ---
/* EfxPresets.cs
/* EfxPresets.cs
* C headers: \OpenAL 1.1 SDK\include\ "efx.h", "efx-creative.h", "Efx-Util.h"
* Spec: Effects Extension Guide.pdf (bundled with OpenAL SDK)
* Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
* See license.txt for license details
* http://www.OpenTK.net */
#endregion
using System;

View file

@ -1,11 +1,9 @@
#region --- OpenTK.OpenAL License ---
/* XRamExtension.cs
/* XRamExtension.cs
* C header: \OpenAL 1.1 SDK\include\xram.h
* Spec: ?
* Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
* See license.txt for license details (MIT)
* http://www.OpenTK.net */
#endregion
using System;
using System.Diagnostics;
@ -21,8 +19,6 @@ namespace OpenTK.Audio.OpenAL
[CLSCompliant(true)]
public sealed class XRamExtension
{
#region Instance state
private bool _valid = false;
/// <summary>Returns True if the X-Ram Extension has been found and could be initialized.</summary>
@ -31,10 +27,6 @@ namespace OpenTK.Audio.OpenAL
get { return _valid; }
}
#endregion Instance state
#region X-RAM Function pointer definitions
// [CLSCompliant(false)]
private delegate bool Delegate_SetBufferMode(int n, ref uint buffers, int value);
//typedef ALboolean (__cdecl *EAXSetBufferMode)(ALsizei n, ALuint *buffers, ALint value);
@ -48,17 +40,9 @@ namespace OpenTK.Audio.OpenAL
//[CLSCompliant(false)]
private Delegate_GetBufferMode Imported_GetBufferMode;
#endregion X-RAM Function pointer definitions
#region X-RAM Tokens
private int AL_EAX_RAM_SIZE, AL_EAX_RAM_FREE,
AL_STORAGE_AUTOMATIC, AL_STORAGE_HARDWARE, AL_STORAGE_ACCESSIBLE;
#endregion X-RAM Tokens
#region Constructor / Extension Loading
/// <summary>
/// Constructs a new XRamExtension instance.
/// </summary>
@ -102,10 +86,6 @@ namespace OpenTK.Audio.OpenAL
_valid = true;
}
#endregion Constructor / Extension Loading
#region Public Methods
/// <summary>Query total amount of X-RAM in bytes.</summary>
public int GetRamSize
{
@ -191,8 +171,6 @@ namespace OpenTK.Audio.OpenAL
uint temp = (uint)buffer;
return GetBufferMode(ref temp);
}
#endregion Public Methods
}
}

View file

@ -1,11 +1,9 @@
#region --- OpenTK.OpenAL License ---
/* AlcFunctions.cs
/* AlcFunctions.cs
* C header: \OpenAL 1.1 SDK\include\Alc.h
* Spec: http://www.openal.org/openal_webstf/specs/OpenAL11Specification.pdf
* Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
* See license.txt for license details
* http://www.OpenTK.net */
#endregion
using System;
using System.Collections.Generic;
@ -73,17 +71,9 @@ namespace OpenTK.Audio.OpenAL
/// <summary>Alc = Audio Library Context</summary>
public static class Alc
{
#region Constants
private const string Lib = AL.Lib;
private const CallingConvention Style = CallingConvention.Cdecl;
#endregion Constants
#region Context Management
#region CreateContext
[DllImport(Alc.Lib, EntryPoint = "alcCreateContext", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity]
unsafe static extern IntPtr sys_CreateContext([In] IntPtr device, [In] int* attrlist);
@ -115,8 +105,6 @@ namespace OpenTK.Audio.OpenAL
}
}
#endregion
[DllImport(Alc.Lib, EntryPoint = "alcMakeContextCurrent", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
static extern bool MakeContextCurrent(IntPtr context);
@ -185,10 +173,6 @@ namespace OpenTK.Audio.OpenAL
}
// ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice( ALCcontext *context );
#endregion Context Management
#region Device Management
/// <summary>This function opens a device by name.</summary>
/// <param name="devicename">a null-terminated string describing a device.</param>
/// <returns>Returns a pointer to the opened device. The return value will be NULL if there is an error.</returns>
@ -203,10 +187,6 @@ namespace OpenTK.Audio.OpenAL
public static extern bool CloseDevice([In] IntPtr device);
// ALC_API ALCboolean ALC_APIENTRY alcCloseDevice( ALCdevice *device );
#endregion Device Management
#region Error support.
/// <summary>This function retrieves the current context error state.</summary>
/// <param name="device">a pointer to the device to retrieve the error state from</param>
/// <returns>Errorcode Int32.</returns>
@ -214,10 +194,6 @@ namespace OpenTK.Audio.OpenAL
public static extern AlcError GetError([In] IntPtr device);
// ALC_API ALCenum ALC_APIENTRY alcGetError( ALCdevice *device );
#endregion Error support.
#region Extension support.
/// <summary>This function queries if a specified context extension is available.</summary>
/// <param name="device">a pointer to the device to be queried for an extension.</param>
/// <param name="extname">a null-terminated string describing the extension.</param>
@ -242,10 +218,6 @@ namespace OpenTK.Audio.OpenAL
public static extern int GetEnumValue([In] IntPtr device, [In] string enumname);
// ALC_API ALCenum ALC_APIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname );
#endregion Extension support.
#region Query functions
[DllImport(Alc.Lib, EntryPoint = "alcGetString", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
private static extern IntPtr GetStringPrivate([In] IntPtr device, AlcGetString param);
// ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param );
@ -370,10 +342,6 @@ namespace OpenTK.Audio.OpenAL
}
}
#endregion Query functions
#region Capture functions
/// <summary>This function opens a capture device by name. </summary>
/// <param name="devicename">a pointer to a device name string.</param>
/// <param name="frequency">the frequency that the buffer should be captured at.</param>
@ -473,8 +441,6 @@ namespace OpenTK.Audio.OpenAL
CaptureSamples(device, ref buffer[0, 0, 0], samples);
}
#endregion Capture functions
}
}

View file

@ -1,11 +1,9 @@
#region --- OpenTK.OpenAL License ---
/* AlcTokens.cs
/* AlcTokens.cs
* C header: \OpenAL 1.1 SDK\include\Alc.h
* Spec: http://www.openal.org/openal_webstf/specs/OpenAL11Specification.pdf
* Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
* See license.txt for license details
* http://www.OpenTK.net */
#endregion
using System;

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2008 the Open Toolkit library, except where noted.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -39,14 +37,8 @@ namespace OpenTK
/// </summary>
public abstract class BindingsBase
{
#region Fields
bool rebuildExtensionList = true;
#endregion
#region Constructors
/// <summary>
/// Constructs a new BindingsBase instance.
/// </summary>
@ -54,10 +46,6 @@ namespace OpenTK
{
}
#endregion
#region Protected Members
/// <summary>
/// Gets or sets a <see cref="System.Boolean"/> that indicates whether the list of supported extensions may have changed.
/// </summary>
@ -222,12 +210,6 @@ namespace OpenTK
Marshal.FreeHGlobal(ptr);
}
#endregion
#region Internal Members
internal abstract void LoadEntryPoints();
#endregion
}
}

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -34,8 +32,6 @@ using System.Reflection;
namespace OpenTK
{
#region BlittableValueType<T>
/// <summary>
/// Checks whether the specified type parameter is a blittable value type.
/// </summary>
@ -45,15 +41,9 @@ namespace OpenTK
/// </remarks>
public static class BlittableValueType<T>
{
#region Fields
static readonly Type Type;
static readonly int stride;
#endregion
#region Constructors
static BlittableValueType()
{
Type = typeof(T);
@ -66,10 +56,6 @@ namespace OpenTK
}
}
#endregion
#region Public Members
/// <summary>
/// Gets the size of the type in bytes or 0 for non-blittable types.
/// </summary>
@ -78,8 +64,6 @@ namespace OpenTK
/// </remarks>
public static int Stride { get { return stride; } }
#region Check
/// <summary>
/// Checks whether the current typename T is blittable.
/// </summary>
@ -102,12 +86,6 @@ namespace OpenTK
return CheckType(type);
}
#endregion
#endregion
#region Private Members
// Checks whether the parameter is a primitive type or consists of primitive types recursively.
// Throws a NotSupportedException if it is not.
static bool CheckType(Type type)
@ -144,14 +122,8 @@ namespace OpenTK
return true;
}
#endregion
}
#endregion
#region BlittableValueType
/// <summary>
/// Checks whether the specified type parameter is a blittable value type.
/// </summary>
@ -161,8 +133,6 @@ namespace OpenTK
/// </remarks>
public static class BlittableValueType
{
#region Check
/// <summary>
/// Checks whether type is a blittable value type.
/// </summary>
@ -217,10 +187,6 @@ namespace OpenTK
return BlittableValueType<T>.Check();
}
#endregion
#region StrideOf
/// <summary>
/// Returns the size of the specified value type in bytes or 0 if the type is not blittable.
/// </summary>
@ -283,9 +249,5 @@ namespace OpenTK
return BlittableValueType<T>.Stride;
}
#endregion
}
#endregion
}

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
#if EXPERIMENTAL

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
#if EXPERIMENTAL
@ -39,15 +37,9 @@ namespace OpenTK.Compute.CL10
/// </summary>
public sealed partial class CL : BindingsBase
{
#region Fields
const string Library = "opencl.dll";
static readonly object sync_root = new object();
#endregion
#region Constructors
static CL()
{
Type imports = typeof(CL).GetNestedType("Core", BindingFlags.Static | BindingFlags.NonPublic);
@ -63,10 +55,6 @@ namespace OpenTK.Compute.CL10
}
}
#endregion
#region Protected Members
/// <summary>
/// Returns a synchronization token unique for the GL class.
/// </summary>
@ -93,9 +81,6 @@ namespace OpenTK.Compute.CL10
//CL.GetExtensionFunctionAddress
}
#endregion
#region Helper Overrides
public static unsafe IntPtr CreateContext(ContextProperties* properties, uint num_devices, IntPtr* devices, IntPtr pfn_notify, IntPtr user_data, OpenTK.Compute.CL10.ErrorCode* errcode_ret)
{
@ -178,8 +163,6 @@ namespace OpenTK.Compute.CL10
IntPtr properties_correct = new IntPtr((int)properties);
return CreateContextFromType(ref properties_correct, device_type, pfn_notify, ref user_data, out errcode_ret);
}
#endregion
}
}

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
#if EXPERIMENTAL

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
#if EXPERIMENTAL

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
#if EXPERIMENTAL

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
#if EXPERIMENTAL
@ -35,22 +33,14 @@ namespace OpenTK.Compute.CL10
{
struct ErrorHelper : IDisposable
{
#region Constructors
public ErrorHelper(IntPtr context)
{
}
#endregion
#region IDisposable Members
public void Dispose()
{
throw new NotImplementedException();
}
#endregion
}
}

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
#if EXPERIMENTAL

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Runtime.InteropServices;

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
#if EXPERIMENTAL
@ -34,12 +32,8 @@ using System.Runtime.InteropServices;
namespace OpenTK.Compute
{
#region struct Handle<T>
struct Handle<T> : IEquatable<Handle<T>>, IComparable<Handle<T>>
{
#region Fields
IntPtr handle;
/// <summary>
@ -50,22 +44,12 @@ namespace OpenTK.Compute
/// <summary>A read-only field that represents a handle that has been initialized to zero.</summary>
public static readonly Handle<T> Zero = new Handle<T>(IntPtr.Zero);
#endregion
#region Constructors
/// <summary>
/// Constructs a new instance with the specified handle.
/// </summary>
/// <param name="h">A System.IntPtr containing the value for this instance.</param>
public Handle(IntPtr h) { handle = h; }
#endregion
#region Public Members
#region ToString
/// <summary>
/// Converts this instance to its equivalent string representation.
/// </summary>
@ -75,10 +59,6 @@ namespace OpenTK.Compute
return Value.ToString();
}
#endregion
#region Equals
/// <summary>
/// Compares this instance to the specified object.
/// </summary>
@ -91,10 +71,6 @@ namespace OpenTK.Compute
return false;
}
#endregion
#region GetHashCode
/// <summary>
/// Returns the hash code for this instance.
/// </summary>
@ -104,10 +80,6 @@ namespace OpenTK.Compute
return Value.GetHashCode();
}
#endregion
#region public static explicit operator IntPtr(Handle<T> c)
/// <summary>
/// Converts the specified ContextHandle to the equivalent IntPtr.
/// </summary>
@ -118,10 +90,6 @@ namespace OpenTK.Compute
return c != Handle<T>.Zero ? c.Value : IntPtr.Zero;
}
#endregion
#region public static explicit operator Handle<T>(IntPtr p)
/// <summary>
/// Converts the specified IntPtr to the equivalent ContextHandle.
/// </summary>
@ -132,8 +100,6 @@ namespace OpenTK.Compute
return new Handle<T>(p);
}
#endregion
/// <summary>
/// Compares two instances for equality.
/// </summary>
@ -156,10 +122,6 @@ namespace OpenTK.Compute
return !left.Equals(right);
}
#endregion
#region IComparable<Handle<T>> Members
/// <summary>
/// Compares the numerical value of this instance to other and returns a value indicating their relative order.
/// </summary>
@ -173,10 +135,6 @@ namespace OpenTK.Compute
}
}
#endregion
#region IEquatable<Handle<T>> Members
/// <summary>
/// Compares this instance to the specified ContextHandle for equality.
/// </summary>
@ -186,12 +144,8 @@ namespace OpenTK.Compute
{
return Value == other.Value;
}
#endregion
}
#endregion
}
#endif

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -47,23 +45,11 @@ namespace OpenTK
volatile static bool initialized;
readonly static object InitLock = new object();
#region Constructors
Configuration() { }
#endregion
#region Public Methods
#region public static bool RunningOnWindows
/// <summary>Gets a System.Boolean indicating whether OpenTK is running on a Windows platform.</summary>
public static bool RunningOnWindows { get { return runningOnWindows; } }
#endregion
#region public static bool RunningOnX11
/// <summary>Gets a System.Boolean indicating whether OpenTK is running on an X11 platform.</summary>
public static bool RunningOnX11
{
@ -78,10 +64,6 @@ namespace OpenTK
get { return runningOnUnix; }
}
#endregion
#region RunningOnSDL2
/// <summary>
/// Gets a System.Boolean indicating whether OpenTK is running on the SDL2 backend.
/// </summary>
@ -91,33 +73,17 @@ namespace OpenTK
private set;
}
#endregion
#region public static bool RunningOnLinux
/// <summary>Gets a System.Boolean indicating whether OpenTK is running on the Linux kernel.</summary>
public static bool RunningOnLinux { get { return runningOnLinux; } }
#endregion
#region public static bool RunningOnMacOS
/// <summary>Gets a System.Boolean indicating whether OpenTK is running on a MacOS platform.</summary>
public static bool RunningOnMacOS { get { return runningOnMacOS; } }
#endregion
#region public static bool RunningOnMono
/// <summary>
/// Gets a System.Boolean indicating whether OpenTK is running on the Mono runtime.
/// </summary>
public static bool RunningOnMono { get { return runningOnMono; } }
#endregion
#region public static bool RunningOnAndroid
/// <summary>
/// Gets a <c>System.Boolean</c> indicating whether
/// OpenTK is running on an Android device.
@ -134,10 +100,6 @@ namespace OpenTK
}
}
#endregion
#region public static bool RunningOnIOS
/// <summary>
/// Gets a <c>System.Boolean</c> indicating whether
/// OpenTK is running on an Android device.
@ -154,12 +116,6 @@ namespace OpenTK
}
}
#endregion
#region --- Private Methods ---
#region private static string DetectUnixKernel()
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
struct utsname
{
@ -321,14 +277,6 @@ namespace OpenTK
#endif
}
#endregion
#endregion
#endregion
#region Internal Methods
// Detects the underlying OS and runtime.
internal static void Init(ToolkitOptions options)
{
@ -365,7 +313,5 @@ namespace OpenTK
}
}
}
#endregion
}
}

View file

@ -1,10 +1,8 @@
#region --- License ---
/* Licensed under the MIT/X11 license.
/* Licensed under the MIT/X11 license.
* Copyright (c) 2006-2008 the OpenTK Team.
* This notice may not be removed from any source distribution.
* See license.txt for licensing detailed licensing details.
*/
#endregion
using System;
using System.Collections.Generic;
@ -17,8 +15,6 @@ namespace OpenTK
/// </summary>
public struct ContextHandle : IComparable<ContextHandle>, IEquatable<ContextHandle>
{
#region Fields
IntPtr handle;
/// <summary>
@ -29,22 +25,12 @@ namespace OpenTK
/// <summary>A read-only field that represents a handle that has been initialized to zero.</summary>
public static readonly ContextHandle Zero = new ContextHandle(IntPtr.Zero);
#endregion
#region Constructors
/// <summary>
/// Constructs a new instance with the specified handle.
/// </summary>
/// <param name="h">A System.IntPtr containing the value for this instance.</param>
public ContextHandle(IntPtr h) { handle = h; }
#endregion
#region Public Members
#region ToString
/// <summary>
/// Converts this instance to its equivalent string representation.
/// </summary>
@ -54,10 +40,6 @@ namespace OpenTK
return Handle.ToString();
}
#endregion
#region Equals
/// <summary>
/// Compares this instance to the specified object.
/// </summary>
@ -70,10 +52,6 @@ namespace OpenTK
return false;
}
#endregion
#region GetHashCode
/// <summary>
/// Returns the hash code for this instance.
/// </summary>
@ -83,10 +61,6 @@ namespace OpenTK
return Handle.GetHashCode();
}
#endregion
#region public static explicit operator IntPtr(ContextHandle c)
/// <summary>
/// Converts the specified ContextHandle to the equivalent IntPtr.
/// </summary>
@ -97,10 +71,6 @@ namespace OpenTK
return c != ContextHandle.Zero ? c.handle : IntPtr.Zero;
}
#endregion
#region public static explicit operator ContextHandle(IntPtr p)
/// <summary>
/// Converts the specified IntPtr to the equivalent ContextHandle.
/// </summary>
@ -111,10 +81,6 @@ namespace OpenTK
return new ContextHandle(p);
}
#endregion
#region public static bool operator ==(ContextHandle left, ContextHandle right)
/// <summary>
/// Compares two ContextHandles for equality.
/// </summary>
@ -126,10 +92,6 @@ namespace OpenTK
return left.Equals(right);
}
#endregion
#region public static bool operator !=(ContextHandle left, ContextHandle right)
/// <summary>
/// Compares two ContextHandles for inequality.
/// </summary>
@ -141,12 +103,6 @@ namespace OpenTK
return !left.Equals(right);
}
#endregion
#endregion
#region IComparable<ContextHandle> Members
/// <summary>
/// Compares the numerical value of this instance to the specified ContextHandle and
/// returns a value indicating their relative order.
@ -158,10 +114,6 @@ namespace OpenTK
unsafe { return (int)((int*)other.handle.ToPointer() - (int*)this.handle.ToPointer()); }
}
#endregion
#region IEquatable<ContextHandle> Members
/// <summary>
/// Compares this instance to the specified ContextHandle for equality.
/// </summary>
@ -171,7 +123,5 @@ namespace OpenTK
{
return Handle == other.Handle;
}
#endregion
}
}

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -43,8 +41,6 @@ namespace OpenTK
// TODO: Add properties that describe the 'usable' size of the Display, i.e. the maximized size without the taskbar etc.
// TODO: Does not detect changes to primary device.
#region Fields
bool primary;
Rectangle bounds;
DisplayResolution current_resolution = new DisplayResolution();
@ -59,10 +55,6 @@ namespace OpenTK
static Platform.IDisplayDeviceDriver implementation;
#endregion
#region Constructors
static DisplayDevice()
{
implementation = Platform.Factory.Default.CreateDisplayDeviceDriver();
@ -88,12 +80,6 @@ namespace OpenTK
this.Id = id;
}
#endregion
#region --- Public Methods ---
#region public Rectangle Bounds
/// <summary>
/// Gets the bounds of this instance in pixel coordinates..
/// </summary>
@ -108,24 +94,12 @@ namespace OpenTK
}
}
#endregion
#region public int Width
/// <summary>Gets a System.Int32 that contains the width of this display in pixels.</summary>
public int Width { get { return current_resolution.Width; } }
#endregion
#region public int Height
/// <summary>Gets a System.Int32 that contains the height of this display in pixels.</summary>
public int Height { get { return current_resolution.Height; } }
#endregion
#region public int BitsPerPixel
/// <summary>Gets a System.Int32 that contains number of bits per pixel of this display. Typical values include 8, 16, 24 and 32.</summary>
public int BitsPerPixel
{
@ -133,10 +107,6 @@ namespace OpenTK
internal set { current_resolution.BitsPerPixel = value; }
}
#endregion
#region public float RefreshRate
/// <summary>
/// Gets a System.Single representing the vertical refresh rate of this display.
/// </summary>
@ -146,10 +116,6 @@ namespace OpenTK
internal set { current_resolution.RefreshRate = value; }
}
#endregion
#region public bool IsPrimary
/// <summary>Gets a System.Boolean that indicates whether this Display is the primary Display in systems with multiple Displays.</summary>
public bool IsPrimary
{
@ -168,10 +134,6 @@ namespace OpenTK
}
}
#endregion
#region public DisplayResolution SelectResolution(int width, int height, int bitsPerPixel, float refreshRate)
/// <summary>
/// Selects an available resolution that matches the specified parameters.
/// </summary>
@ -200,10 +162,6 @@ namespace OpenTK
return resolution;
}
#endregion
#region public IList<DisplayResolution> AvailableResolutions
/// <summary>
/// Gets the list of <see cref="DisplayResolution"/> objects available on this device.
/// </summary>
@ -217,10 +175,6 @@ namespace OpenTK
}
}
#endregion
#region public void ChangeResolution(DisplayResolution resolution)
/// <summary>Changes the resolution of the DisplayDevice.</summary>
/// <param name="resolution">The resolution to set. <see cref="DisplayDevice.SelectResolution"/></param>
/// <exception cref="Graphics.GraphicsModeException">Thrown if the requested resolution could not be set.</exception>
@ -247,10 +201,6 @@ namespace OpenTK
//effect.FadeIn();
}
#endregion
#region public void ChangeResolution(int width, int height, int bitsPerPixel, float refreshRate)
/// <summary>Changes the resolution of the DisplayDevice.</summary>
/// <param name="width">The new width of the DisplayDevice.</param>
/// <param name="height">The new height of the DisplayDevice.</param>
@ -262,10 +212,6 @@ namespace OpenTK
this.ChangeResolution(this.SelectResolution(width, height, bitsPerPixel, refreshRate));
}
#endregion
#region public void RestoreResolution()
/// <summary>Restores the original resolution of the DisplayDevice.</summary>
/// <exception cref="Graphics.GraphicsModeException">Thrown if the original resolution could not be restored.</exception>
public void RestoreResolution()
@ -285,20 +231,12 @@ namespace OpenTK
}
}
#endregion
#region public static DisplayDevice Default
/// <summary>Gets the default (primary) display of this system.</summary>
public static DisplayDevice Default
{
get { return implementation.GetDisplay(DisplayIndex.Primary); }
}
#endregion
#region GetDisplay
/// <summary>
/// Gets the <see cref="DisplayDevice"/> for the specified <see cref="DisplayIndex"/>.
/// </summary>
@ -309,14 +247,6 @@ namespace OpenTK
return implementation.GetDisplay(index);
}
#endregion
#endregion
#region --- Internal Methods ---
#region internal DisplayResolution OriginalResolution
/// <summary>
/// Gets the original resolution of this instance.
/// </summary>
@ -326,10 +256,6 @@ namespace OpenTK
set { original_resolution = value; }
}
#endregion
#region FromPoint
internal static DisplayDevice FromPoint(int x, int y)
{
for (DisplayIndex i = DisplayIndex.First; i < DisplayIndex.Sixth; i++)
@ -346,14 +272,6 @@ namespace OpenTK
return null;
}
#endregion
#endregion
#region --- Private Methods ---
#region DisplayResolution FindResolution(int width, int height, int bitsPerPixel, float refreshRate)
DisplayResolution FindResolution(int width, int height, int bitsPerPixel, float refreshRate)
{
return available_resolutions.Find(delegate(DisplayResolution test)
@ -366,14 +284,6 @@ namespace OpenTK
});
}
#endregion
#endregion
#region --- Overrides ---
#region public override string ToString()
/// <summary>
/// Returns a System.String representing this DisplayDevice.
/// </summary>
@ -384,10 +294,6 @@ namespace OpenTK
Bounds.ToString(), available_resolutions.Count);
}
#endregion
#region public override bool Equals(object obj)
///// <summary>Determines whether the specified DisplayDevices are equal.</summary>
///// <param name="obj">The System.Object to check against.</param>
///// <returns>True if the System.Object is an equal DisplayDevice; false otherwise.</returns>
@ -405,23 +311,13 @@ namespace OpenTK
// return false;
//}
#endregion
#region public override int GetHashCode()
///// <summary>Returns a unique hash representing this DisplayDevice.</summary>
///// <returns>A System.Int32 that may serve as a hash code for this DisplayDevice.</returns>
////public override int GetHashCode()
//{
// return current_resolution.GetHashCode() ^ IsPrimary.GetHashCode() ^ available_resolutions.Count;
//}
#endregion
#endregion
}
#region --- FadeEffect ---
#if false
class FadeEffect : IDisposable
{
@ -525,16 +421,11 @@ namespace OpenTK
form.Visible = false;
}
#region IDisposable Members
public void Dispose()
{
foreach (Form form in forms)
form.Dispose();
}
#endregion
}
#endif
#endregion
}

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2010 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;

View file

@ -1,10 +1,8 @@
#region --- License ---
/* Licensed under the MIT/X11 license.
* Copyright (c) 2006-2008 the OpenTK team.
* This notice may not be removed.
* See license.txt for licensing detailed licensing details.
*/
#endregion
using System;
using System.Collections.Generic;
@ -23,12 +21,8 @@ namespace OpenTK
int bits_per_pixel;
float refresh_rate;
#region --- Constructors ---
internal DisplayResolution() { }
#region public DisplayResolution(int width, int height, int bitsPerPixel, float refreshRate)
// Creates a new DisplayResolution object for the primary DisplayDevice.
internal DisplayResolution(int x, int y, int width, int height, int bitsPerPixel, float refreshRate)
{
@ -43,10 +37,6 @@ namespace OpenTK
this.refresh_rate = refreshRate;
}
#endregion
#region public DisplayResolution(int width, int height, int bitsPerPixel, float refreshRate, DisplayDevice device)
#if false
/// <summary>
@ -75,13 +65,6 @@ namespace OpenTK
this.refresh_rate = res.refresh_rate;
}
#endif
#endregion
#endregion
#region --- Public Methods ---
#region Bounds
/// <summary>
/// Gets a System.Drawing.Rectangle that contains the bounds of this display device.
@ -93,10 +76,6 @@ namespace OpenTK
get { return bounds; }
}
#endregion
#region public int Width
/// <summary>Gets a System.Int32 that contains the width of this display in pixels.</summary>
public int Width
{
@ -104,10 +83,6 @@ namespace OpenTK
internal set { bounds.Width = value; }
}
#endregion
#region public int Height
/// <summary>Gets a System.Int32 that contains the height of this display in pixels.</summary>
public int Height
{
@ -115,10 +90,6 @@ namespace OpenTK
internal set { bounds.Height = value; }
}
#endregion
#region public int BitsPerPixel
/// <summary>Gets a System.Int32 that contains number of bits per pixel of this display. Typical values include 8, 16, 24 and 32.</summary>
public int BitsPerPixel
{
@ -126,10 +97,6 @@ namespace OpenTK
internal set { bits_per_pixel = value; }
}
#endregion
#region public float RefreshRate
/// <summary>
/// Gets a System.Single representing the vertical refresh rate of this display.
/// </summary>
@ -139,14 +106,6 @@ namespace OpenTK
internal set { refresh_rate = value; }
}
#endregion
#endregion
#region --- Overrides ---
#region public override string ToString()
/// <summary>
/// Returns a System.String representing this DisplayResolution.
/// </summary>
@ -158,10 +117,6 @@ namespace OpenTK
#pragma warning restore 612,618
}
#endregion
#region public override bool Equals(object obj)
/// <summary>Determines whether the specified resolutions are equal.</summary>
/// <param name="obj">The System.Object to check against.</param>
/// <returns>True if the System.Object is an equal DisplayResolution; false otherwise.</returns>
@ -181,10 +136,6 @@ namespace OpenTK
return false;
}
#endregion
#region public override int GetHashCode()
/// <summary>Returns a unique hash representing this resolution.</summary>
/// <returns>A System.Int32 that may serve as a hash code for this resolution.</returns>
public override int GetHashCode()
@ -194,12 +145,6 @@ namespace OpenTK
#pragma warning restore 612,618
}
#endregion
#endregion
#region --- Operator Overloads ---
/// <summary>
/// Compares two instances for equality.
/// </summary>
@ -226,7 +171,5 @@ namespace OpenTK
{
return !(left == right);
}
#endregion
}
}

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -73,8 +71,6 @@ namespace OpenTK
/// </remarks>
public class GameWindow : NativeWindow, IGameWindow, IDisposable
{
#region --- Fields ---
const double MaxFrequency = 500.0; // Frequency cap for Update/RenderFrame events
readonly Stopwatch watch = new Stopwatch();
@ -99,30 +95,16 @@ namespace OpenTK
FrameEventArgs update_args = new FrameEventArgs();
FrameEventArgs render_args = new FrameEventArgs();
#endregion
#region --- Contructors ---
#region public GameWindow()
/// <summary>Constructs a new GameWindow with sensible default attributes.</summary>
public GameWindow()
: this(640, 480, GraphicsMode.Default, "OpenTK Game Window", 0, DisplayDevice.Default) { }
#endregion
#region public GameWindow(int width, int height)
/// <summary>Constructs a new GameWindow with the specified attributes.</summary>
/// <param name="width">The width of the GameWindow in pixels.</param>
/// <param name="height">The height of the GameWindow in pixels.</param>
public GameWindow(int width, int height)
: this(width, height, GraphicsMode.Default, "OpenTK Game Window", 0, DisplayDevice.Default) { }
#endregion
#region public GameWindow(int width, int height, GraphicsMode mode)
/// <summary>Constructs a new GameWindow with the specified attributes.</summary>
/// <param name="width">The width of the GameWindow in pixels.</param>
/// <param name="height">The height of the GameWindow in pixels.</param>
@ -130,10 +112,6 @@ namespace OpenTK
public GameWindow(int width, int height, GraphicsMode mode)
: this(width, height, mode, "OpenTK Game Window", 0, DisplayDevice.Default) { }
#endregion
#region public GameWindow(int width, int height, GraphicsMode mode, string title)
/// <summary>Constructs a new GameWindow with the specified attributes.</summary>
/// <param name="width">The width of the GameWindow in pixels.</param>
/// <param name="height">The height of the GameWindow in pixels.</param>
@ -142,10 +120,6 @@ namespace OpenTK
public GameWindow(int width, int height, GraphicsMode mode, string title)
: this(width, height, mode, title, 0, DisplayDevice.Default) { }
#endregion
#region public GameWindow(int width, int height, GraphicsMode mode, string title, GameWindowFlags options)
/// <summary>Constructs a new GameWindow with the specified attributes.</summary>
/// <param name="width">The width of the GameWindow in pixels.</param>
/// <param name="height">The height of the GameWindow in pixels.</param>
@ -155,10 +129,6 @@ namespace OpenTK
public GameWindow(int width, int height, GraphicsMode mode, string title, GameWindowFlags options)
: this(width, height, mode, title, options, DisplayDevice.Default) { }
#endregion
#region public GameWindow(int width, int height, GraphicsMode mode, string title, GameWindowFlags options, DisplayDevice device)
/// <summary>Constructs a new GameWindow with the specified attributes.</summary>
/// <param name="width">The width of the GameWindow in pixels.</param>
/// <param name="height">The height of the GameWindow in pixels.</param>
@ -170,10 +140,6 @@ namespace OpenTK
: this(width, height, mode, title, options, device, 1, 0, GraphicsContextFlags.Default)
{ }
#endregion
#region public GameWindow(int width, int height, GraphicsMode mode, string title, GameWindowFlags options, DisplayDevice device, int major, int minor, GraphicsContextFlags flags)
/// <summary>Constructs a new GameWindow with the specified attributes.</summary>
/// <param name="width">The width of the GameWindow in pixels.</param>
/// <param name="height">The height of the GameWindow in pixels.</param>
@ -189,10 +155,6 @@ namespace OpenTK
: this(width, height, mode, title, options, device, major, minor, flags, null)
{ }
#endregion
#region public GameWindow(int width, int height, GraphicsMode mode, string title, GameWindowFlags options, DisplayDevice device, int major, int minor, GraphicsContextFlags flags, IGraphicsContext sharedContext)
/// <summary>Constructs a new GameWindow with the specified attributes.</summary>
/// <param name="width">The width of the GameWindow in pixels.</param>
/// <param name="height">The height of the GameWindow in pixels.</param>
@ -228,16 +190,6 @@ namespace OpenTK
}
}
#endregion
#endregion
#region --- Public Members ---
#region Methods
#region Dispose
/// <summary>
/// Disposes of the GameWindow, releasing all resources consumed by it.
/// </summary>
@ -265,10 +217,6 @@ namespace OpenTK
GC.SuppressFinalize(this);
}
#endregion
#region Exit
/// <summary>
/// Closes the GameWindow. Equivalent to <see cref="NativeWindow.Close"/> method.
/// </summary>
@ -281,10 +229,6 @@ namespace OpenTK
Close();
}
#endregion
#region MakeCurrent
/// <summary>
/// Makes the GraphicsContext current on the calling thread.
/// </summary>
@ -294,10 +238,6 @@ namespace OpenTK
Context.MakeCurrent(WindowInfo);
}
#endregion
#region OnClose
/// <summary>
/// Called when the NativeWindow is about to close.
/// </summary>
@ -315,10 +255,6 @@ namespace OpenTK
}
#endregion
#region OnLoad
/// <summary>
/// Called after an OpenGL context has been established, but before entering the main loop.
/// </summary>
@ -328,10 +264,6 @@ namespace OpenTK
Load(this, e);
}
#endregion
#region OnUnload
/// <summary>
/// Called after GameWindow.Exit was called, but before destroying the OpenGL context.
/// </summary>
@ -341,10 +273,6 @@ namespace OpenTK
Unload(this, e);
}
#endregion
#region public void Run()
/// <summary>
/// Enters the game loop of the GameWindow using the maximum update rate.
/// </summary>
@ -354,10 +282,6 @@ namespace OpenTK
Run(0.0, 0.0);
}
#endregion
#region public void Run(double updateFrequency)
/// <summary>
/// Enters the game loop of the GameWindow using the specified update rate.
/// maximum possible render frequency.
@ -367,10 +291,6 @@ namespace OpenTK
Run(updateRate, 0.0);
}
#endregion
#region public void Run(double updates_per_second, double frames_per_second)
/// <summary>
/// Enters the game loop of the GameWindow updating and rendering at the specified frequency.
/// </summary>
@ -521,10 +441,6 @@ namespace OpenTK
render_time = timestamp - render_timestamp;
}
#endregion
#region SwapBuffers
/// <summary>
/// Swaps the front and back buffer, presenting the rendered scene to the user.
/// </summary>
@ -534,14 +450,6 @@ namespace OpenTK
this.Context.SwapBuffers();
}
#endregion
#endregion
#region Properties
#region Context
/// <summary>
/// Returns the opengl IGraphicsContext associated with the current GameWindow.
/// </summary>
@ -554,10 +462,6 @@ namespace OpenTK
}
}
#endregion
#region IsExiting
/// <summary>
/// Gets a value indicating whether the shutdown sequence has been initiated
/// for this window, by calling GameWindow.Exit() or hitting the 'close' button.
@ -573,24 +477,14 @@ namespace OpenTK
}
}
#endregion
#region --- GameWindow Timing ---
// TODO: Disabled because it is not reliable enough. Use vsync as a workaround.
//#region public bool AllowSleep
//public bool AllowSleep
//{
// get { return allow_sleep; }
// set { allow_sleep = value; }
//}
//#endregion
#region RenderFrequency
/// <summary>
/// Gets a double representing the actual frequency of RenderFrame events, in hertz (i.e. fps or frames per second).
/// </summary>
@ -605,10 +499,6 @@ namespace OpenTK
}
}
#endregion
#region RenderPeriod
/// <summary>
/// Gets a double representing the period of RenderFrame events, in seconds.
/// </summary>
@ -621,10 +511,6 @@ namespace OpenTK
}
}
#endregion
#region RenderTime
/// <summary>
/// Gets a double representing the time spent in the RenderFrame function, in seconds.
/// </summary>
@ -642,10 +528,6 @@ namespace OpenTK
}
}
#endregion
#region TargetRenderFrequency
/// <summary>
/// Gets or sets a double representing the target render frequency, in hertz.
/// </summary>
@ -677,10 +559,6 @@ namespace OpenTK
}
}
#endregion
#region TargetRenderPeriod
/// <summary>
/// Gets or sets a double representing the target render period, in seconds.
/// </summary>
@ -710,10 +588,6 @@ namespace OpenTK
}
}
#endregion
#region TargetUpdateFrequency
/// <summary>
/// Gets or sets a double representing the target update frequency, in hertz.
/// </summary>
@ -745,10 +619,6 @@ namespace OpenTK
}
}
#endregion
#region TargetUpdatePeriod
/// <summary>
/// Gets or sets a double representing the target update period, in seconds.
/// </summary>
@ -778,10 +648,6 @@ namespace OpenTK
}
}
#endregion
#region UpdateFrequency
/// <summary>
/// Gets a double representing the frequency of UpdateFrame events, in hertz.
/// </summary>
@ -796,10 +662,6 @@ namespace OpenTK
}
}
#endregion
#region UpdatePeriod
/// <summary>
/// Gets a double representing the period of UpdateFrame events, in seconds.
/// </summary>
@ -812,10 +674,6 @@ namespace OpenTK
}
}
#endregion
#region UpdateTime
/// <summary>
/// Gets a double representing the time spent in the UpdateFrame function, in seconds.
/// </summary>
@ -828,12 +686,6 @@ namespace OpenTK
}
}
#endregion
#endregion
#region VSync
/// <summary>
/// Gets or sets the VSyncMode.
/// </summary>
@ -877,10 +729,6 @@ namespace OpenTK
}
}
#endregion
#region WindowState
/// <summary>
/// Gets or states the state of the NativeWindow.
/// </summary>
@ -899,12 +747,6 @@ namespace OpenTK
Context.Update(WindowInfo);
}
}
#endregion
#endregion
#region Events
/// <summary>
/// Occurs before the window is displayed for the first time.
/// </summary>
@ -925,24 +767,12 @@ namespace OpenTK
/// </summary>
public event EventHandler<FrameEventArgs> UpdateFrame = delegate { };
#endregion
#endregion
#region --- Protected Members ---
#region Dispose
/// <summary>
/// Override to add custom cleanup logic.
/// </summary>
/// <param name="manual">True, if this method was called by the application; false if this was called by the finalizer thread.</param>
protected virtual void Dispose(bool manual) { }
#endregion
#region OnRenderFrame
/// <summary>
/// Called when the frame is rendered.
/// </summary>
@ -955,10 +785,6 @@ namespace OpenTK
RenderFrame(this, e);
}
#endregion
#region OnUpdateFrame
/// <summary>
/// Called when the frame is updated.
/// </summary>
@ -971,20 +797,12 @@ namespace OpenTK
UpdateFrame(this, e);
}
#endregion
#region OnWindowInfoChanged
/// <summary>
/// Called when the WindowInfo for this GameWindow has changed.
/// </summary>
/// <param name="e">Not used.</param>
protected virtual void OnWindowInfoChanged(EventArgs e) { }
#endregion
#region OnResize
/// <summary>
/// Called when this window is resized.
/// </summary>
@ -1000,55 +818,25 @@ namespace OpenTK
glContext.Update(base.WindowInfo);
}
#endregion
#endregion
#region --- Private Members ---
#region OnLoadInternal
private void OnLoadInternal(EventArgs e)
{
OnLoad(e);
}
#endregion
#region OnRenderFrameInternal
private void OnRenderFrameInternal(FrameEventArgs e) { if (Exists && !isExiting) OnRenderFrame(e); }
#endregion
#region OnUnloadInternal
private void OnUnloadInternal(EventArgs e) { OnUnload(e); }
#endregion
#region OnUpdateFrameInternal
private void OnUpdateFrameInternal(FrameEventArgs e) { if (Exists && !isExiting) OnUpdateFrame(e); }
#endregion
#region OnWindowInfoChangedInternal
private void OnWindowInfoChangedInternal(EventArgs e)
{
glContext.MakeCurrent(WindowInfo);
OnWindowInfoChanged(e);
}
#endregion
#endregion
}
#region public enum VSyncMode
/// <summary>
/// Enumerates available VSync modes.
/// </summary>
@ -1068,6 +856,4 @@ namespace OpenTK
/// </summary>
Adaptive,
}
#endregion
}

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2008 the Open Toolkit library, except where noted.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -41,8 +39,6 @@ namespace OpenTK.Graphics
[Serializable]
public struct Color4 : IEquatable<Color4>
{
#region Fields
/// <summary>
/// The red component of this Color4 structure.
/// </summary>
@ -63,10 +59,6 @@ namespace OpenTK.Graphics
/// </summary>
public float A;
#endregion
#region Constructors
/// <summary>
/// Constructs a new Color4 structure from the specified components.
/// </summary>
@ -97,10 +89,6 @@ namespace OpenTK.Graphics
A = a / (float)Byte.MaxValue;
}
#endregion
#region Public Members
/// <summary>
/// Converts this color to an integer representation with 8 bits per channel.
/// </summary>
@ -194,8 +182,6 @@ namespace OpenTK.Graphics
return String.Format("{{(R, G, B, A) = ({0}, {1}, {2}, {3})}}", R.ToString(), G.ToString(), B.ToString(), A.ToString());
}
#region System colors
/// <summary>
/// Gets the system color with (R, G, B, A) = (255, 255, 255, 0).
/// </summary>
@ -901,14 +887,6 @@ namespace OpenTK.Graphics
/// </summary>
public static Color4 YellowGreen { get { return new Color4(154, 205, 50, 255); } }
#endregion
#endregion
#region Color conversions
#region sRGB
/// <summary>
/// Converts sRGB color values to RGB color values.
/// </summary>
@ -993,10 +971,6 @@ namespace OpenTK.Graphics
return new Color4(r, g, b, rgb.A);
}
#endregion
#region HSL
/// <summary>
/// Converts HSL color values to RGB color values.
/// </summary>
@ -1113,10 +1087,6 @@ namespace OpenTK.Graphics
return new Vector4(hue, saturation, lightness, rgb.A);
}
#endregion
#region HSV
/// <summary>
/// Converts HSV color values to RGB color values.
/// </summary>
@ -1227,10 +1197,6 @@ namespace OpenTK.Graphics
return new Vector4(hue, saturation, M, rgb.A);
}
#endregion
#region XYZ
/// <summary>
/// Converts XYZ color values to RGB color values.
/// </summary>
@ -1267,10 +1233,6 @@ namespace OpenTK.Graphics
return new Vector4(x, y, z, rgb.A);
}
#endregion
#region YUV
/// <summary>
/// Converts YCbCr color values to RGB color values.
/// </summary>
@ -1308,10 +1270,6 @@ namespace OpenTK.Graphics
return new Vector4(y, u, v, rgb.A);
}
#endregion
#region HCY
/// <summary>
/// Converts HCY color values to RGB color values.
/// </summary>
@ -1416,12 +1374,6 @@ namespace OpenTK.Graphics
return new Vector4(hue, C, luminance, rgb.A);
}
#endregion
#endregion
#region IEquatable<Color4> Members
/// <summary>
/// Compares whether this Color4 structure is equal to the specified Color4.
/// </summary>
@ -1435,7 +1387,5 @@ namespace OpenTK.Graphics
this.B == other.B &&
this.A == other.A;
}
#endregion
}
}

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2010 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -42,8 +40,6 @@ namespace OpenTK.Graphics
bool isIndexed;
int bitsPerPixel;
#region Constructors
/// <summary>
/// Constructs a new ColorFormat with the specified aggregate bits per pixel.
/// </summary>
@ -113,10 +109,6 @@ namespace OpenTK.Graphics
this.isIndexed = true;
}
#endregion
#region Public Members
/// <summary>Gets the bits per pixel for the Red channel.</summary>
public int Red { get { return red; } private set { red = (byte)value; } }
/// <summary>Gets the bits per pixel for the Green channel.</summary>
@ -135,10 +127,6 @@ namespace OpenTK.Graphics
/// </summary>
public static readonly ColorFormat Empty = new ColorFormat(0);
#endregion
#region Operator Overloads
/// <summary>
/// Converts the specified bpp into a new ColorFormat.
/// </summary>
@ -154,10 +142,6 @@ namespace OpenTK.Graphics
// return mode.BitsPerPixel;
//}
#endregion
#region IComparable<ColorFormat> Members
/// <summary>
/// Compares two instances.
/// </summary>
@ -179,10 +163,6 @@ namespace OpenTK.Graphics
return result;
}
#endregion
#region IEquatable<ColorFormat> Members
/// <summary>
/// Compares whether this ColorFormat structure is equal to the specified ColorFormat.
/// </summary>
@ -197,10 +177,6 @@ namespace OpenTK.Graphics
Alpha == other.Alpha;
}
#endregion
#region Overrides
/// <summary>
/// Indicates whether this instance and a specified object are equal.
/// </summary>
@ -294,7 +270,5 @@ namespace OpenTK.Graphics
{
return string.Format("{0} ({1})", BitsPerPixel, (IsIndexed ? " indexed" : Red.ToString() + Green.ToString() + Blue.ToString() + Alpha.ToString()));
}
#endregion
}
}

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
namespace OpenTK.Graphics.ES10
{

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
namespace OpenTK.Graphics.ES10
{

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -44,17 +42,11 @@ namespace OpenTK.Graphics.ES10
// as that would cause infinite recursion!
struct ErrorHelper : IDisposable
{
#region Fields
static readonly object SyncRoot = new object();
static readonly Dictionary<GraphicsContext, List<ErrorCode>> ContextErrors =
new Dictionary<GraphicsContext, List<ErrorCode>>();
readonly GraphicsContext Context;
#endregion
#region Constructors
public ErrorHelper(IGraphicsContext context)
{
if (context == null)
@ -69,10 +61,6 @@ namespace OpenTK.Graphics.ES10
ResetErrors();
}
#endregion
#region Public Members
// Retrieve all OpenGL errors to clear the error list.
// See http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/geterror.html
[Conditional("DEBUG")]
@ -120,15 +108,9 @@ namespace OpenTK.Graphics.ES10
}
}
#endregion
#region IDisposable Members
public void Dispose()
{
CheckErrors();
}
#endregion
}
}

View file

@ -1,5 +1,4 @@
#region License
//
//
// ES11Obsolete.cs
//
// Author:
@ -25,7 +24,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#endregion
using System;

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -44,17 +42,11 @@ namespace OpenTK.Graphics.ES11
// as that would cause infinite recursion!
struct ErrorHelper : IDisposable
{
#region Fields
static readonly object SyncRoot = new object();
static readonly Dictionary<GraphicsContext, List<ErrorCode>> ContextErrors =
new Dictionary<GraphicsContext, List<ErrorCode>>();
readonly GraphicsContext Context;
#endregion
#region Constructors
public ErrorHelper(IGraphicsContext context)
{
if (context == null)
@ -69,10 +61,6 @@ namespace OpenTK.Graphics.ES11
ResetErrors();
}
#endregion
#region Public Members
// Retrieve all OpenGL errors to clear the error list.
// See http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/geterror.html
[Conditional("DEBUG")]
@ -120,15 +108,9 @@ namespace OpenTK.Graphics.ES11
}
}
#endregion
#region IDisposable Members
public void Dispose()
{
CheckErrors();
}
#endregion
}
}

View file

@ -23,8 +23,6 @@ namespace OpenTK.Graphics.ES11
static byte[] EntryPointNames;
static int[] EntryPointNameOffsets;
#region Constructors
/// <summary>
/// Constructs a new instance.
/// </summary>
@ -35,10 +33,6 @@ namespace OpenTK.Graphics.ES11
_EntryPointNameOffsetsInstance = EntryPointNameOffsets;
}
#endregion
#region --- Protected Members ---
/// <summary>
/// Returns a synchronization token unique for the GL class.
/// </summary>
@ -47,7 +41,5 @@ namespace OpenTK.Graphics.ES11
get { return sync_root; }
}
#endregion
}
}

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -44,17 +42,11 @@ namespace OpenTK.Graphics.ES20
// as that would cause infinite recursion!
struct ErrorHelper : IDisposable
{
#region Fields
static readonly object SyncRoot = new object();
static readonly Dictionary<GraphicsContext, List<ErrorCode>> ContextErrors =
new Dictionary<GraphicsContext, List<ErrorCode>>();
readonly GraphicsContext Context;
#endregion
#region Constructors
public ErrorHelper(IGraphicsContext context)
{
if (context == null)
@ -69,10 +61,6 @@ namespace OpenTK.Graphics.ES20
ResetErrors();
}
#endregion
#region Public Members
// Retrieve all OpenGL errors to clear the error list.
// See http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/geterror.html
[Conditional("DEBUG")]
@ -120,15 +108,9 @@ namespace OpenTK.Graphics.ES20
}
}
#endregion
#region IDisposable Members
public void Dispose()
{
CheckErrors();
}
#endregion
}
}

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -51,8 +49,6 @@ namespace OpenTK.Graphics.ES20
static byte[] EntryPointNames;
static int[] EntryPointNameOffsets;
#region Constructors
/// <summary>
/// Constructs a new instance.
/// </summary>
@ -63,10 +59,6 @@ namespace OpenTK.Graphics.ES20
_EntryPointNameOffsetsInstance = EntryPointNameOffsets;
}
#endregion
#region --- Protected Members ---
/// <summary>
/// Returns a synchronization token unique for the GL class.
/// </summary>
@ -75,10 +67,6 @@ namespace OpenTK.Graphics.ES20
get { return sync_root; }
}
#endregion
#region Helper Overloads
#pragma warning disable 3019
#pragma warning disable 1591
#pragma warning disable 1572
@ -87,8 +75,6 @@ namespace OpenTK.Graphics.ES20
// Note: Mono 1.9.1 truncates StringBuilder results (for 'out string' parameters).
// We work around this issue by doubling the StringBuilder capacity.
#region public static void ClearColor() overloads
public static void ClearColor(Color color)
{
GL.ClearColor(color.R / 255.0f, color.G / 255.0f, color.B / 255.0f, color.A / 255.0f);
@ -99,10 +85,6 @@ namespace OpenTK.Graphics.ES20
GL.ClearColor(color.R, color.G, color.B, color.A);
}
#endregion
#region public static void BlendColor() overloads
public static void BlendColor(Color color)
{
GL.BlendColor(color.R / 255.0f, color.G / 255.0f, color.B / 255.0f, color.A / 255.0f);
@ -113,10 +95,6 @@ namespace OpenTK.Graphics.ES20
GL.BlendColor(color.R, color.G, color.B, color.A);
}
#endregion
#region Uniform
[CLSCompliant(false)]
public static void Uniform2(int location, ref Vector2 vector)
{
@ -194,12 +172,6 @@ namespace OpenTK.Graphics.ES20
}
#endregion
#region Shaders
#region GetActiveAttrib
public static string GetActiveAttrib(int program, int index, out int size, out ActiveAttribType type)
{
int length;
@ -210,10 +182,6 @@ namespace OpenTK.Graphics.ES20
return sb.ToString();
}
#endregion
#region GetActiveUniform
public static string GetActiveUniform(int program, int uniformIndex, out int size, out ActiveUniformType type)
{
int length;
@ -224,10 +192,6 @@ namespace OpenTK.Graphics.ES20
return sb.ToString();
}
#endregion
#region public static void ShaderSource(Int32 shader, System.String @string)
public static void ShaderSource(Int32 shader, System.String @string)
{
unsafe
@ -237,10 +201,6 @@ namespace OpenTK.Graphics.ES20
}
}
#endregion
#region public static string GetShaderInfoLog(Int32 shader)
public static string GetShaderInfoLog(Int32 shader)
{
string info;
@ -248,10 +208,6 @@ namespace OpenTK.Graphics.ES20
return info;
}
#endregion
#region public static void GetShaderInfoLog(Int32 shader, out string info)
public static void GetShaderInfoLog(Int32 shader, out string info)
{
unsafe
@ -269,10 +225,6 @@ namespace OpenTK.Graphics.ES20
}
}
#endregion
#region public static string GetProgramInfoLog(Int32 program)
public static string GetProgramInfoLog(Int32 program)
{
string info;
@ -280,10 +232,6 @@ namespace OpenTK.Graphics.ES20
return info;
}
#endregion
#region public static void GetProgramInfoLog(Int32 program, out string info)
public static void GetProgramInfoLog(Int32 program, out string info)
{
unsafe
@ -300,69 +248,39 @@ namespace OpenTK.Graphics.ES20
}
}
#endregion
#endregion
#region public static void VertexAttrib2(Int32 index, ref Vector2 v)
[CLSCompliant(false)]
public static void VertexAttrib2(Int32 index, ref Vector2 v)
{
GL.VertexAttrib2(index, v.X, v.Y);
}
#endregion
#region public static void VertexAttrib3(Int32 index, ref Vector3 v)
[CLSCompliant(false)]
public static void VertexAttrib3(Int32 index, ref Vector3 v)
{
GL.VertexAttrib3(index, v.X, v.Y, v.Z);
}
#endregion
#region public static void VertexAttrib4(Int32 index, ref Vector4 v)
[CLSCompliant(false)]
public static void VertexAttrib4(Int32 index, ref Vector4 v)
{
GL.VertexAttrib4(index, v.X, v.Y, v.Z, v.W);
}
#endregion
#region public static void VertexAttrib2(Int32 index, Vector2 v)
public static void VertexAttrib2(Int32 index, Vector2 v)
{
GL.VertexAttrib2(index, v.X, v.Y);
}
#endregion
#region public static void VertexAttrib3(Int32 index, Vector3 v)
public static void VertexAttrib3(Int32 index, Vector3 v)
{
GL.VertexAttrib3(index, v.X, v.Y, v.Z);
}
#endregion
#region public static void VertexAttrib4(Int32 index, Vector4 v)
public static void VertexAttrib4(Int32 index, Vector4 v)
{
GL.VertexAttrib4(index, v.X, v.Y, v.Z, v.W);
}
#endregion
#region VertexAttribPointer
public static void VertexAttribPointer(int index, int size, VertexAttribPointerType type, bool normalized, int stride, int offset)
{
VertexAttribPointer(index, size, type, normalized, stride, (IntPtr)offset);
@ -374,19 +292,11 @@ namespace OpenTK.Graphics.ES20
VertexAttribPointer(index, size, type, normalized, stride, (IntPtr)offset);
}
#endregion
#region DrawElements
public static void DrawElements(BeginMode mode, int count, DrawElementsType type, int offset)
{
DrawElements((PrimitiveType)mode, count, type, new IntPtr(offset));
}
#endregion
#region Get[Float|Double]
public static void GetFloat(GetPName pname, out Vector2 vector)
{
unsafe
@ -423,10 +333,6 @@ namespace OpenTK.Graphics.ES20
}
}
#endregion
#region Viewport
public static void Viewport(Size size)
{
GL.Viewport(0, 0, size.Width, size.Height);
@ -452,14 +358,11 @@ namespace OpenTK.Graphics.ES20
GL.Viewport(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
}
#endif
#endregion
#pragma warning restore 3019
#pragma warning restore 1591
#pragma warning restore 1572
#pragma warning restore 1573
#endregion
}
#pragma warning disable 1574 // XML comment cref attribute could not be resolved, compiler bug in Mono 3.4.0

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -44,17 +42,11 @@ namespace OpenTK.Graphics.ES30
// as that would cause infinite recursion!
struct ErrorHelper : IDisposable
{
#region Fields
static readonly object SyncRoot = new object();
static readonly Dictionary<GraphicsContext, List<ErrorCode>> ContextErrors =
new Dictionary<GraphicsContext, List<ErrorCode>>();
readonly GraphicsContext Context;
#endregion
#region Constructors
public ErrorHelper(IGraphicsContext context)
{
if (context == null)
@ -69,10 +61,6 @@ namespace OpenTK.Graphics.ES30
ResetErrors();
}
#endregion
#region Public Members
// Retrieve all OpenGL errors to clear the error list.
// See http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/geterror.html
[Conditional("DEBUG")]
@ -120,15 +108,9 @@ namespace OpenTK.Graphics.ES30
}
}
#endregion
#region IDisposable Members
public void Dispose()
{
CheckErrors();
}
#endregion
}
}

View file

@ -1,5 +1,4 @@
#region License
//
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2013 the Open Toolkit library.
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
@ -51,8 +49,6 @@ namespace OpenTK.Graphics.ES30
static byte[] EntryPointNames;
static int[] EntryPointNameOffsets;
#region Constructors
/// <summary>
/// Constructs a new instance.
/// </summary>
@ -63,10 +59,6 @@ namespace OpenTK.Graphics.ES30
_EntryPointNameOffsetsInstance = EntryPointNameOffsets;
}
#endregion
#region --- Protected Members ---
/// <summary>
/// Returns a synchronization token unique for the GL class.
/// </summary>
@ -75,10 +67,6 @@ namespace OpenTK.Graphics.ES30
get { return sync_root; }
}
#endregion
#region Helper Overloads
#pragma warning disable 3019
#pragma warning disable 1591
#pragma warning disable 1572
@ -87,8 +75,6 @@ namespace OpenTK.Graphics.ES30
// Note: Mono 1.9.1 truncates StringBuilder results (for 'out string' parameters).
// We work around this issue by doubling the StringBuilder capacity.
#region public static void ClearColor() overloads
public static void ClearColor(Color color)
{
GL.ClearColor(color.R / 255.0f, color.G / 255.0f, color.B / 255.0f, color.A / 255.0f);
@ -99,10 +85,6 @@ namespace OpenTK.Graphics.ES30
GL.ClearColor(color.R, color.G, color.B, color.A);
}
#endregion
#region public static void BlendColor() overloads
public static void BlendColor(Color color)
{
GL.BlendColor(color.R / 255.0f, color.G / 255.0f, color.B / 255.0f, color.A / 255.0f);
@ -113,10 +95,6 @@ namespace OpenTK.Graphics.ES30
GL.BlendColor(color.R, color.G, color.B, color.A);
}
#endregion
#region Uniform
[CLSCompliant(false)]
public static void Uniform2(int location, ref Vector2 vector)
{
@ -194,12 +172,6 @@ namespace OpenTK.Graphics.ES30
}
#endregion
#region Shaders
#region GetActiveAttrib
public static string GetActiveAttrib(int program, int index, out int size, out ActiveAttribType type)
{
int length;
@ -210,10 +182,6 @@ namespace OpenTK.Graphics.ES30
return sb.ToString();
}
#endregion
#region GetActiveUniform
public static string GetActiveUniform(int program, int uniformIndex, out int size, out ActiveUniformType type)
{
int length;
@ -224,10 +192,6 @@ namespace OpenTK.Graphics.ES30
return sb.ToString();
}
#endregion
#region public static void ShaderSource(Int32 shader, System.String @string)
public static void ShaderSource(Int32 shader, System.String @string)
{
unsafe
@ -237,10 +201,6 @@ namespace OpenTK.Graphics.ES30
}
}
#endregion
#region public static string GetShaderInfoLog(Int32 shader)
public static string GetShaderInfoLog(Int32 shader)
{
string info;
@ -248,10 +208,6 @@ namespace OpenTK.Graphics.ES30
return info;
}
#endregion
#region public static void GetShaderInfoLog(Int32 shader, out string info)
public static void GetShaderInfoLog(Int32 shader, out string info)
{
unsafe
@ -269,10 +225,6 @@ namespace OpenTK.Graphics.ES30
}
}
#endregion
#region public static string GetProgramInfoLog(Int32 program)
public static string GetProgramInfoLog(Int32 program)
{
string info;
@ -280,10 +232,6 @@ namespace OpenTK.Graphics.ES30
return info;
}
#endregion
#region public static void GetProgramInfoLog(Int32 program, out string info)
public static void GetProgramInfoLog(Int32 program, out string info)
{
unsafe
@ -300,69 +248,39 @@ namespace OpenTK.Graphics.ES30
}
}
#endregion
#endregion
#region public static void VertexAttrib2(Int32 index, ref Vector2 v)
[CLSCompliant(false)]
public static void VertexAttrib2(Int32 index, ref Vector2 v)
{
GL.VertexAttrib2(index, v.X, v.Y);
}
#endregion
#region public static void VertexAttrib3(Int32 index, ref Vector3 v)
[CLSCompliant(false)]
public static void VertexAttrib3(Int32 index, ref Vector3 v)
{
GL.VertexAttrib3(index, v.X, v.Y, v.Z);
}
#endregion
#region public static void VertexAttrib4(Int32 index, ref Vector4 v)
[CLSCompliant(false)]
public static void VertexAttrib4(Int32 index, ref Vector4 v)
{
GL.VertexAttrib4(index, v.X, v.Y, v.Z, v.W);
}
#endregion
#region public static void VertexAttrib2(Int32 index, Vector2 v)
public static void VertexAttrib2(Int32 index, Vector2 v)
{
GL.VertexAttrib2(index, v.X, v.Y);
}
#endregion
#region public static void VertexAttrib3(Int32 index, Vector3 v)
public static void VertexAttrib3(Int32 index, Vector3 v)
{
GL.VertexAttrib3(index, v.X, v.Y, v.Z);
}
#endregion
#region public static void VertexAttrib4(Int32 index, Vector4 v)
public static void VertexAttrib4(Int32 index, Vector4 v)
{
GL.VertexAttrib4(index, v.X, v.Y, v.Z, v.W);
}
#endregion
#region VertexAttribPointer
public static void VertexAttribPointer(int index, int size, VertexAttribPointerType type, bool normalized, int stride, int offset)
{
VertexAttribPointer(index, size, type, normalized, stride, (IntPtr)offset);
@ -374,10 +292,6 @@ namespace OpenTK.Graphics.ES30
VertexAttribPointer(index, size, type, normalized, stride, (IntPtr)offset);
}
#endregion
#region Get[Float|Double]
public static void GetFloat(GetPName pname, out Vector2 vector)
{
unsafe
@ -414,10 +328,6 @@ namespace OpenTK.Graphics.ES30
}
}
#endregion
#region Viewport
public static void Viewport(Size size)
{
GL.Viewport(0, 0, size.Width, size.Height);
@ -443,14 +353,11 @@ namespace OpenTK.Graphics.ES30
GL.Viewport(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
}
#endif
#endregion
#pragma warning restore 3019
#pragma warning restore 1591
#pragma warning restore 1572
#pragma warning restore 1573
#endregion
}
#pragma warning disable 1574 // XML comment cref attribute could not be resolved, compiler bug in Mono 3.4.0

View file

@ -1,4 +1,3 @@
#region License
//
// The Open Toolkit Library License
//
@ -23,7 +22,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Diagnostics;

Some files were not shown because too many files have changed in this diff Show more