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