示例#1
0
 public static VkSurfaceFormatKHR [] GetSurfaceFormats(this VkPhysicalDevice phy, VkSurfaceKHR surf)
 {
     vkGetPhysicalDeviceSurfaceFormatsKHR(phy, surf, out uint count, IntPtr.Zero);
     VkSurfaceFormatKHR [] formats = new VkSurfaceFormatKHR [count];
     vkGetPhysicalDeviceSurfaceFormatsKHR(phy, surf, out count, formats.Pin());
     formats.Unpin();
     return(formats);
 }
        /// <summary>
        /// </summary>
        /// <param name="device"></param>
        /// <param name="surface"></param>
        /// <returns></returns>
        public static VkSurfaceFormatKHR[] Formats(this VkPhysicalDevice device, VkSurfaceKHR surface)
        {
            VkSurfaceFormatKHR[] result;
            UInt32 count;

            vkGetPhysicalDeviceSurfaceFormatsKHR(device, surface, &count, null);
            result = new VkSurfaceFormatKHR[count];
            if (count != 0)
            {
                fixed(VkSurfaceFormatKHR *pointer = result)
                {
                    vkGetPhysicalDeviceSurfaceFormatsKHR(device, surface, &count, pointer);
                }
            }

            return(result);
        }