/// <summary> /// Obtain the array of presentable images associated with a swapchain. /// </summary> public unsafe SharpVk.Image[] GetImages() { try { SharpVk.Image[] result = default(SharpVk.Image[]); uint swapchainImageCount = default(uint); SharpVk.Interop.Image *marshalledSwapchainImages = default(SharpVk.Interop.Image *); SharpVk.Interop.Khronos.VkSwapchainKHRGetImagesDelegate commandDelegate = commandCache.Cache.vkGetSwapchainImagesKHR; Result methodResult = commandDelegate(this.parent.handle, this.handle, &swapchainImageCount, marshalledSwapchainImages); if (SharpVkException.IsError(methodResult)) { throw SharpVkException.Create(methodResult); } marshalledSwapchainImages = (SharpVk.Interop.Image *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Image>((uint)(swapchainImageCount))); commandDelegate(this.parent.handle, this.handle, &swapchainImageCount, marshalledSwapchainImages); if (marshalledSwapchainImages != null) { var fieldPointer = new SharpVk.Image[(uint)(swapchainImageCount)]; for (int index = 0; index < (uint)(swapchainImageCount); index++) { fieldPointer[index] = new SharpVk.Image(this.parent, marshalledSwapchainImages[index]); } result = fieldPointer; } else { result = null; } return(result); } finally { Interop.HeapUtil.FreeAll(); } }
public static extern SharpVk.Result vkCreateImage(SharpVk.Interop.Device device, SharpVk.Interop.ImageCreateInfo *createInfo, SharpVk.Interop.AllocationCallbacks *allocator, SharpVk.Interop.Image *image);