コード例 #1
0
        internal static unsafe DisplayModeProperties MarshalFrom(Interop.DisplayModeProperties *value)
        {
            DisplayModeProperties result = new DisplayModeProperties();

            result.Parameters = value->Parameters;
            return(result);
        }
コード例 #2
0
 /// <summary>
 /// Query the set of mode properties supported by the display.
 /// </summary>
 public DisplayModeProperties[] GetDisplayModeProperties(Display display)
 {
     unsafe
     {
         try
         {
             var commandDelegate            = this.commandCache.GetCommandDelegate <Interop.vkGetDisplayModePropertiesKHR>("vkGetDisplayModePropertiesKHR", "instance");
             DisplayModeProperties[] result = default(DisplayModeProperties[]);
             Result          commandResult;
             Interop.Display marshalledDisplay = default(Interop.Display);
             display?.MarshalTo(&marshalledDisplay);
             uint propertyCount;
             Interop.DisplayModeProperties *marshalledProperties = null;
             commandResult = commandDelegate(this.handle, marshalledDisplay, &propertyCount, null);
             if (SharpVkException.IsError(commandResult))
             {
                 throw SharpVkException.Create(commandResult);
             }
             marshalledProperties = (Interop.DisplayModeProperties *)Interop.HeapUtil.Allocate <Interop.DisplayModeProperties>((uint)propertyCount);
             commandResult        = commandDelegate(this.handle, marshalledDisplay, &propertyCount, marshalledProperties);
             if (SharpVkException.IsError(commandResult))
             {
                 throw SharpVkException.Create(commandResult);
             }
             result = new DisplayModeProperties[(uint)propertyCount];
             for (int index = 0; index < (uint)propertyCount; index++)
             {
                 result[index] = DisplayModeProperties.MarshalFrom(&marshalledProperties[index]);
             }
             return(result);
         }
         finally
         {
             Interop.HeapUtil.FreeLog();
         }
     }
 }