Beispiel #1
0
 public static VkPresentModeKHR[] GetSurfacePresentModes(this VkPhysicalDevice phy, VkSurfaceKHR surf)
 {
     vkGetPhysicalDeviceSurfacePresentModesKHR(phy, surf, out uint count, IntPtr.Zero);
     VkPresentModeKHR[] modes = new VkPresentModeKHR[count];
     vkGetPhysicalDeviceSurfacePresentModesKHR(phy, surf, out count, modes.Pin());
     modes.Unpin();
     return(modes);
 }
Beispiel #2
0
 public VkPresentModeKHR[] GetSurfacePresentModes(VkSurfaceKHR surf)
 {
     vkGetPhysicalDeviceSurfacePresentModesKHR(phy, surf, out uint count, IntPtr.Zero);
     if (Type.GetType("Mono.Runtime") == null)
     {
         uint[] modes = new uint[count];                //this cause an error on mono
         vkGetPhysicalDeviceSurfacePresentModesKHR(phy, surf, out count, modes.Pin());
         modes.Unpin();
         VkPresentModeKHR[] mds = new VkPresentModeKHR[count];
         for (int i = 0; i < count; i++)
         {
             mds[i] = (VkPresentModeKHR)modes[i];
         }
         return(mds);
     }
     else
     {
         VkPresentModeKHR[] modes = new VkPresentModeKHR[count];                //enums not blittable on ms.Net
         vkGetPhysicalDeviceSurfacePresentModesKHR(phy, surf, out count, modes.Pin());
         modes.Unpin();
         return(modes);
     }
 }