This commit is contained in:
TinyHerm committed 2026-11-24 23:40:08 +03:00
commit 1c7a8cf25f
579 files changed
+83196

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
using System;
using NvAPIWrapper;
using NvAPIWrapper.Native;
using NvAPIWrapper.Native.Display.Structures;
namespace VibranceHud;
internal sealed class NvapiDisplayAccess : INvapiDisplayAccess
{
private DisplayHandle[] _displays = Array.Empty<DisplayHandle>();
public int Resolve()
{
NVIDIA.Initialize();
_displays = DisplayApi.EnumNvidiaDisplayHandle();
return _displays.Length;
}
public int ReadCurrentLevel(int display)
{
return DisplayApi.GetDVCInfoEx(_displays[display]).CurrentLevel;
}
public int ReadDefaultLevel(int display)
{
return DisplayApi.GetDVCInfoEx(_displays[display]).DefaultLevel;
}
public string DisplayId(int display)
{
return DisplayApi.GetAssociatedNvidiaDisplayName(_displays[display]);
}
public void WriteLevel(int display, int level)
{
DisplayApi.SetDVCLevelEx(_displays[display], level);
}
}