aboutsummaryrefslogtreecommitdiffstatsci
path: root/vulkan
diff options
context:
space:
mode:
Diffstat (limited to 'vulkan')
-rw-r--r--vulkan/PNext.cs18
-rw-r--r--vulkan/vulkan.csproj2
2 files changed, 19 insertions, 1 deletions
diff --git a/vulkan/PNext.cs b/vulkan/PNext.cs
index 783e757..9ca9709 100644
--- a/vulkan/PNext.cs
+++ b/vulkan/PNext.cs
@@ -27,6 +27,24 @@ namespace Vulkan
init();
Marshal.WriteIntPtr(handle + 4, pNext);
}
+ /// <summary>
+ /// Allocate on HGlobal a new structure of type T and set current value
+ /// ensure instance is Disposed.
+ /// </summary>
+ public PNext (T instance) {
+ handle = Marshal.AllocHGlobal(Marshal.SizeOf<T>());
+ Marshal.StructureToPtr(instance, handle, false);
+ }
+ /// <summary>
+ /// Allocate on HGlobal a new structure of type T set current value and
+ /// the PNext field.
+ /// ensure instance is Disposed.
+ /// </summary>
+ public PNext (T instance, IntPtr pNext) {
+ handle = Marshal.AllocHGlobal(Marshal.SizeOf<T>());
+ Marshal.StructureToPtr(instance, handle, false);
+ Marshal.WriteIntPtr(handle + 4, pNext);
+ }
void init() {
handle = Marshal.AllocHGlobal(Marshal.SizeOf<T>());
Type t = typeof(T);
diff --git a/vulkan/vulkan.csproj b/vulkan/vulkan.csproj
index 209502d..84ec7bd 100644
--- a/vulkan/vulkan.csproj
+++ b/vulkan/vulkan.csproj
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.1</TargetFrameworks>
- <AssemblyVersion>0.5.0</AssemblyVersion>
+ <AssemblyVersion>0.5.1</AssemblyVersion>
<AssemblyName>Vulkan</AssemblyName>
<PackageVersion>$(AssemblyVersion)</PackageVersion>