/// <summary> /// /// </summary> /// <param name="pointer"> /// </param> internal static unsafe DisplayProperties2 MarshalFrom(SharpVk.Interop.Khronos.DisplayProperties2 *pointer) { DisplayProperties2 result = default(DisplayProperties2); result.DisplayProperties = SharpVk.Khronos.DisplayProperties.MarshalFrom(&pointer->DisplayProperties); return(result); }
/// <summary> /// /// </summary> /// <param name="extendedHandle"> /// The PhysicalDevice handle to extend. /// </param> public static unsafe SharpVk.Khronos.DisplayProperties2[] GetDisplayProperties2(this SharpVk.PhysicalDevice extendedHandle) { try { SharpVk.Khronos.DisplayProperties2[] result = default(SharpVk.Khronos.DisplayProperties2[]); uint marshalledPropertyCount = default(uint); CommandCache commandCache = default(CommandCache); SharpVk.Interop.Khronos.DisplayProperties2 *marshalledProperties = default(SharpVk.Interop.Khronos.DisplayProperties2 *); commandCache = extendedHandle.commandCache; SharpVk.Interop.Khronos.VkPhysicalDeviceGetDisplayProperties2Delegate commandDelegate = commandCache.Cache.vkGetPhysicalDeviceDisplayProperties2KHR; Result methodResult = commandDelegate(extendedHandle.handle, &marshalledPropertyCount, marshalledProperties); if (SharpVkException.IsError(methodResult)) { throw SharpVkException.Create(methodResult); } marshalledProperties = (SharpVk.Interop.Khronos.DisplayProperties2 *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.DisplayProperties2>((uint)(marshalledPropertyCount))); commandDelegate(extendedHandle.handle, &marshalledPropertyCount, marshalledProperties); if (marshalledProperties != null) { var fieldPointer = new SharpVk.Khronos.DisplayProperties2[(uint)(marshalledPropertyCount)]; for (int index = 0; index < (uint)(marshalledPropertyCount); index++) { fieldPointer[index] = SharpVk.Khronos.DisplayProperties2.MarshalFrom(&marshalledProperties[index]); } result = fieldPointer; } else { result = null; } return(result); } finally { Interop.HeapUtil.FreeAll(); } }