From 0d73706c88bd8c5f7b8ca7d6ae9d18eba4f0d921 Mon Sep 17 00:00:00 2001 From: thefiddler Date: Sat, 9 Nov 2013 19:24:43 +0100 Subject: [PATCH] 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). --- Source/Bind/Utilities.cs | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/Source/Bind/Utilities.cs b/Source/Bind/Utilities.cs index 8cb69166..2ba6f941 100644 --- a/Source/Bind/Utilities.cs +++ b/Source/Bind/Utilities.cs @@ -62,7 +62,19 @@ namespace Bind /// /// Function returns a typed pointer - we have to copy the data to an array to protect it from the GC. /// - ArrayReturnType + ArrayReturnType, + /// + /// 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) + /// + ConvenienceReturnType, + /// + /// 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() + /// + 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)