Example #1
0
        /// <summary>
        ///
        /// </summary>
        internal static unsafe DisplayPlaneProperties MarshalFrom(SharpVk.Interop.Khronos.DisplayPlaneProperties *pointer)
        {
            DisplayPlaneProperties result = default(DisplayPlaneProperties);

            result.CurrentDisplay    = new SharpVk.Khronos.Display(pointer->CurrentDisplay);
            result.CurrentStackIndex = pointer->CurrentStackIndex;
            return(result);
        }
 /// <summary>
 /// Query the plane properties.
 /// </summary>
 /// <param name="extendedHandle">
 /// The PhysicalDevice handle to extend.
 /// </param>
 public static unsafe SharpVk.Khronos.DisplayPlaneProperties[] GetDisplayPlaneProperties(this SharpVk.PhysicalDevice extendedHandle)
 {
     try
     {
         SharpVk.Khronos.DisplayPlaneProperties[] result = default(SharpVk.Khronos.DisplayPlaneProperties[]);
         uint         marshalledPropertyCount            = default(uint);
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Khronos.DisplayPlaneProperties *marshalledProperties = default(SharpVk.Interop.Khronos.DisplayPlaneProperties *);
         commandCache = extendedHandle.commandCache;
         SharpVk.Interop.Khronos.VkPhysicalDeviceGetDisplayPlanePropertiesDelegate commandDelegate = commandCache.Cache.vkGetPhysicalDeviceDisplayPlanePropertiesKHR;
         Result methodResult = commandDelegate(extendedHandle.handle, &marshalledPropertyCount, marshalledProperties);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
         marshalledProperties = (SharpVk.Interop.Khronos.DisplayPlaneProperties *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.DisplayPlaneProperties>((uint)(marshalledPropertyCount)));
         commandDelegate(extendedHandle.handle, &marshalledPropertyCount, marshalledProperties);
         if (marshalledProperties != null)
         {
             var fieldPointer = new SharpVk.Khronos.DisplayPlaneProperties[(uint)(marshalledPropertyCount)];
             for (int index = 0; index < (uint)(marshalledPropertyCount); index++)
             {
                 fieldPointer[index] = SharpVk.Khronos.DisplayPlaneProperties.MarshalFrom(&marshalledProperties[index]);
             }
             result = fieldPointer;
         }
         else
         {
             result = null;
         }
         return(result);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }