Gamma Init

This commit is contained in:
Serge
2024-02-16 15:55:37 +01:00
parent 42a598f177
commit cf84fa0616
103 changed files with 7907 additions and 41 deletions

View File

@@ -0,0 +1,33 @@
using System.Runtime.InteropServices;
using WindowsDisplayAPI.Native.Structures;
namespace WindowsDisplayAPI.Native.DisplayConfig.Structures
{
// https://msdn.microsoft.com/en-us/library/vs/alm/mt622103(v=vs.85).aspx
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
internal struct DisplayConfigSupportVirtualResolution
{
// ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable
[MarshalAs(UnmanagedType.Struct)] private readonly DisplayConfigDeviceInfoHeader _Header;
[MarshalAs(UnmanagedType.U4)] private readonly int _DisableMonitorVirtualResolution;
public bool DisableMonitorVirtualResolution
{
get => _DisableMonitorVirtualResolution > 0;
}
public DisplayConfigSupportVirtualResolution(LUID adapter, uint targetId) : this()
{
_Header = new DisplayConfigDeviceInfoHeader(adapter, targetId, GetType(),
DisplayConfigDeviceInfoType.GetSupportVirtualResolution);
}
public DisplayConfigSupportVirtualResolution(LUID adapter, uint targetId, bool disableMonitorVirtualResolution)
: this()
{
_DisableMonitorVirtualResolution = disableMonitorVirtualResolution ? 1 : 0;
_Header = new DisplayConfigDeviceInfoHeader(adapter, targetId, GetType(),
DisplayConfigDeviceInfoType.SetSupportVirtualResolution);
}
}
}