Beispiel #1
0
        public unsafe PresentMode[] GetSurfacePresentModes(Surface surface)
        {
            uint count = 0;

            GetSurfacePresentModes(surface, ref count, null);

            var result = new PresentMode[count];

            if (count > 0)
            {
                fixed(PresentMode *resultPointer = &result[0])
                GetSurfacePresentModes(surface, ref count, resultPointer);
            }

            return(result);
        }
Beispiel #2
0
 /// <summary>
 /// Query supported presentation modes.
 /// </summary>
 public PresentMode[] GetSurfacePresentModes(Surface surface)
 {
     unsafe
     {
         try
         {
             var             commandDelegate = this.commandCache.GetCommandDelegate <Interop.vkGetPhysicalDeviceSurfacePresentModesKHR>("vkGetPhysicalDeviceSurfacePresentModesKHR", "instance");
             PresentMode[]   result          = default(PresentMode[]);
             Result          commandResult;
             Interop.Surface marshalledSurface = default(Interop.Surface);
             surface?.MarshalTo(&marshalledSurface);
             uint         presentModeCount;
             PresentMode *marshalledPresentModes = null;
             commandResult = commandDelegate(this.handle, marshalledSurface, &presentModeCount, null);
             if (SharpVkException.IsError(commandResult))
             {
                 throw SharpVkException.Create(commandResult);
             }
             marshalledPresentModes = (PresentMode *)Interop.HeapUtil.Allocate <int>((uint)presentModeCount);
             commandResult          = commandDelegate(this.handle, marshalledSurface, &presentModeCount, marshalledPresentModes);
             if (SharpVkException.IsError(commandResult))
             {
                 throw SharpVkException.Create(commandResult);
             }
             result = new PresentMode[(uint)presentModeCount];
             for (int index = 0; index < (uint)presentModeCount; index++)
             {
                 result[index] = marshalledPresentModes[index];
             }
             return(result);
         }
         finally
         {
             Interop.HeapUtil.FreeLog();
         }
     }
 }
Beispiel #3
0
        public unsafe PresentMode[] GetSurfacePresentModes(Surface surface)
        {
            uint count = 0;
            GetSurfacePresentModes(surface, ref count, null);

            var result = new PresentMode[count];
            if (count > 0)
            {
                fixed (PresentMode* resultPointer = &result[0])
                    GetSurfacePresentModes(surface, ref count, resultPointer);
            }

            return result;
        }
Beispiel #4
0
 internal unsafe void GetSurfacePresentModes(Surface surface, ref uint presentModeCount, PresentMode* presentModes)
 {
     fixed (uint* __presentModeCount__ = &presentModeCount)
     {
         vkGetPhysicalDeviceSurfacePresentModesKHR(this, surface, __presentModeCount__, presentModes).CheckError();
     }
 }
Beispiel #5
0
 internal static unsafe extern Result vkGetPhysicalDeviceSurfacePresentModesKHR(PhysicalDevice physicalDevice, Surface surface, uint* presentModeCount, PresentMode* presentModes);