Ejemplo n.º 1
0
        public static VkResult Create(SoftwareDevice device, VkSwapchainCreateInfoKHR createInfo, out VkSwapchainKHR swapChain)
        {
            SoftwareSwapchain retVal = new SoftwareSwapchain(device, createInfo);

            retVal.m_Images.Clear();

            while (retVal.m_Images.Count < createInfo.minImageCount)
            {
                VkResult      resultCode;
                SoftwareImage image = SoftwareImage.CreateSwapchainImage(device, createInfo, out resultCode);
                if (resultCode != VkResult.VK_SUCCESS)
                {
                    swapChain = default(VkSwapchainKHR);
                    return(resultCode);
                }
                retVal.m_Images.Add(image);
            }

            swapChain = retVal;
            return(VkResult.VK_SUCCESS);
        }
Ejemplo n.º 2
0
 public override VkResult CreateSwapchain(VkSwapchainCreateInfoKHR createInfo, out VkSwapchainKHR swapChain)
 {
     return(SoftwareSwapchain.Create(this, createInfo, out swapChain));
 }