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:
parent
417aa67139
commit
0d73706c88
1 changed files with 13 additions and 16 deletions
|
@ -62,7 +62,19 @@ namespace Bind
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Function returns a typed pointer - we have to copy the data to an array to protect it from the GC.
|
/// Function returns a typed pointer - we have to copy the data to an array to protect it from the GC.
|
||||||
/// </summary>
|
/// </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
|
#endregion
|
||||||
|
@ -235,21 +247,6 @@ namespace Bind
|
||||||
return s;
|
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
|
#endregion
|
||||||
|
|
||||||
#region internal static string GetGL2Extension(string name)
|
#region internal static string GetGL2Extension(string name)
|
||||||
|
|
Loading…
Reference in a new issue