Ejemplo n.º 1
0
 /// <summary>
 /// Query information about the available displays.
 /// </summary>
 public DisplayProperties[] GetDisplayProperties()
 {
     unsafe
     {
         try
         {
             var commandDelegate        = this.commandCache.GetCommandDelegate <Interop.vkGetPhysicalDeviceDisplayPropertiesKHR>("vkGetPhysicalDeviceDisplayPropertiesKHR", "instance");
             DisplayProperties[] result = default(DisplayProperties[]);
             Result commandResult;
             uint   propertyCount;
             Interop.DisplayProperties *marshalledProperties = null;
             commandResult = commandDelegate(this.handle, &propertyCount, null);
             if (SharpVkException.IsError(commandResult))
             {
                 throw SharpVkException.Create(commandResult);
             }
             marshalledProperties = (Interop.DisplayProperties *)Interop.HeapUtil.Allocate <Interop.DisplayProperties>((uint)propertyCount);
             commandResult        = commandDelegate(this.handle, &propertyCount, marshalledProperties);
             if (SharpVkException.IsError(commandResult))
             {
                 throw SharpVkException.Create(commandResult);
             }
             result = new DisplayProperties[(uint)propertyCount];
             for (int index = 0; index < (uint)propertyCount; index++)
             {
                 result[index] = DisplayProperties.MarshalFrom(&marshalledProperties[index]);
             }
             return(result);
         }
         finally
         {
             Interop.HeapUtil.FreeLog();
         }
     }
 }
Ejemplo n.º 2
0
        internal static unsafe DisplayProperties MarshalFrom(Interop.DisplayProperties *value)
        {
            DisplayProperties result = new DisplayProperties();

            result.DisplayName          = Interop.HeapUtil.MarshalFrom(value->DisplayName);
            result.PhysicalDimensions   = value->PhysicalDimensions;
            result.PhysicalResolution   = value->PhysicalResolution;
            result.SupportedTransforms  = value->SupportedTransforms;
            result.PlaneReorderPossible = value->PlaneReorderPossible;
            result.PersistentContent    = value->PersistentContent;
            return(result);
        }