diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2023-10-28 16:47:23 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2023-10-28 16:47:23 +0200 |
| commit | ff4eddb31a156fa9103058a715ef6af0c6ab1743 (patch) | |
| tree | 978d7beac6211ff8bb4ffaa8ac9181193c25cd4f /vulkan | |
| parent | b65719d05fc71b2b631334fbc06da58963769063 (diff) | |
v0.5.1 save commitv0.5.1
Diffstat (limited to 'vulkan')
| -rw-r--r-- | vulkan/PNext.cs | 18 | ||||
| -rw-r--r-- | vulkan/vulkan.csproj | 2 |
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> |