aboutsummaryrefslogtreecommitdiffstatsci
path: root/vulkan/ExtensionMethods.cs
diff options
context:
space:
mode:
Diffstat (limited to 'vulkan/ExtensionMethods.cs')
-rw-r--r--vulkan/ExtensionMethods.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/vulkan/ExtensionMethods.cs b/vulkan/ExtensionMethods.cs
index 4102f07..6f31329 100644
--- a/vulkan/ExtensionMethods.cs
+++ b/vulkan/ExtensionMethods.cs
@@ -74,6 +74,12 @@ namespace Vulkan {
handles.Add (hnd.AddrOfPinnedObject (), hnd);
return hnd.AddrOfPinnedObject ();
}
+ public static IntPtr PinPointer (this object obj) {
+ GCHandle hnd = GCHandle.Alloc (obj, GCHandleType.Pinned);
+ handles.Add (hnd.AddrOfPinnedObject (), hnd);
+ return hnd.AddrOfPinnedObject ();
+ }
+
//pin with pinning context
public static IntPtr Pin (this object obj, PinnedObjects ctx) {