Added new WrapperTypes; removed unused code

New WrapperTypes for convenience functions: ConvenienceReturnType to
replace an "out" parameter by a return value, and
ConvenienceArrayReturnType to replace an out array parameter by a
single return value (array count of 1 only).
This commit is contained in:
thefiddler 2013-11-09 19:24:43 +01:00
parent 417aa67139
commit 0d73706c88

View file

@ -62,7 +62,19 @@ namespace Bind
/// <summary>
/// Function returns a typed pointer - we have to copy the data to an array to protect it from the GC.
/// </summary>
ArrayReturnType
ArrayReturnType,
/// <summary>
/// Function normally returns a value via an out parameter.
/// This overload returns a single item directly.
/// e.g. void GetIntegerv(enum, out int) => int GetInteger(enum)
/// </summary>
ConvenienceReturnType,
/// <summary>
/// Function normally returns an array via an out parameter.
/// This overload returns a single item directly.
/// e.g. void GenBuffers(int n, int[]) => int GenBuffer()
/// </summary>
ConvenienceArrayReturnType,
}
#endregion
@ -235,21 +247,6 @@ namespace Bind
return s;
}
// Merges the specified delegate collections.
internal static void Merge(DelegateCollection delegates, DelegateCollection new_delegates)
{
foreach (var d in new_delegates.Values.SelectMany(v => v))
{
Merge(delegates, d);
}
}
// Merges the given delegate into the delegate list.
internal static void Merge(DelegateCollection delegates, Delegate t)
{
delegates.Add(t);
}
#endregion
#region internal static string GetGL2Extension(string name)