diff --git a/app/Fans.Designer.cs b/app/Fans.Designer.cs index cb7bfb9f..d61a7e1c 100644 --- a/app/Fans.Designer.cs +++ b/app/Fans.Designer.cs @@ -31,12 +31,12 @@ namespace GHelper /// private void InitializeComponent() { - ChartArea chartArea13 = new ChartArea(); - Title title13 = new Title(); - ChartArea chartArea14 = new ChartArea(); - Title title14 = new Title(); - ChartArea chartArea15 = new ChartArea(); - Title title15 = new Title(); + ChartArea chartArea1 = new ChartArea(); + Title title1 = new Title(); + ChartArea chartArea2 = new ChartArea(); + Title title2 = new Title(); + ChartArea chartArea3 = new ChartArea(); + Title title3 = new Title(); panelFans = new Panel(); labelFansResult = new Label(); labelTip = new Label(); @@ -67,6 +67,14 @@ namespace GHelper pictureBox1 = new PictureBox(); labelPowerLimits = new Label(); panelGPU = new Panel(); + panelGPUTemp = new Panel(); + labelGPUTemp = new Label(); + labelGPUTempTitle = new Label(); + trackGPUTemp = new TrackBar(); + panelGPUBoost = new Panel(); + labelGPUBoost = new Label(); + labelGPUBoostTitle = new Label(); + trackGPUBoost = new TrackBar(); panelGPUMemory = new Panel(); labelGPUMemory = new Label(); labelGPUMemoryTitle = new Label(); @@ -78,14 +86,6 @@ namespace GHelper panelTitleGPU = new Panel(); pictureGPU = new PictureBox(); labelGPU = new Label(); - panelGPUBoost = new Panel(); - labelGPUBoost = new Label(); - labelGPUBoostTitle = new Label(); - trackGPUBoost = new TrackBar(); - panelGPUTemp = new Panel(); - labelGPUTemp = new Label(); - labelGPUTempTitle = new Label(); - trackGPUTemp = new TrackBar(); panelFans.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit(); tableFanCharts.SuspendLayout(); @@ -102,16 +102,16 @@ namespace GHelper panelTitleCPU.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit(); panelGPU.SuspendLayout(); + panelGPUTemp.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)trackGPUTemp).BeginInit(); + panelGPUBoost.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)trackGPUBoost).BeginInit(); panelGPUMemory.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)trackGPUMemory).BeginInit(); panelGPUCore.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)trackGPUCore).BeginInit(); panelTitleGPU.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)pictureGPU).BeginInit(); - panelGPUBoost.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)trackGPUBoost).BeginInit(); - panelGPUTemp.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)trackGPUTemp).BeginInit(); SuspendLayout(); // // panelFans @@ -211,8 +211,8 @@ namespace GHelper // // chartGPU // - chartArea13.Name = "ChartArea1"; - chartGPU.ChartAreas.Add(chartArea13); + chartArea1.Name = "ChartArea1"; + chartGPU.ChartAreas.Add(chartArea1); chartGPU.Dock = DockStyle.Fill; chartGPU.Location = new Point(2, 350); chartGPU.Margin = new Padding(2, 10, 2, 10); @@ -220,13 +220,13 @@ namespace GHelper chartGPU.Size = new Size(760, 320); chartGPU.TabIndex = 17; chartGPU.Text = "chartGPU"; - title13.Name = "Title1"; - chartGPU.Titles.Add(title13); + title1.Name = "Title1"; + chartGPU.Titles.Add(title1); // // chartCPU // - chartArea14.Name = "ChartArea1"; - chartCPU.ChartAreas.Add(chartArea14); + chartArea2.Name = "ChartArea1"; + chartCPU.ChartAreas.Add(chartArea2); chartCPU.Dock = DockStyle.Fill; chartCPU.Location = new Point(2, 10); chartCPU.Margin = new Padding(2, 10, 2, 10); @@ -234,13 +234,13 @@ namespace GHelper chartCPU.Size = new Size(760, 320); chartCPU.TabIndex = 14; chartCPU.Text = "chartCPU"; - title14.Name = "Title1"; - chartCPU.Titles.Add(title14); + title2.Name = "Title1"; + chartCPU.Titles.Add(title2); // // chartMid // - chartArea15.Name = "ChartArea3"; - chartMid.ChartAreas.Add(chartArea15); + chartArea3.Name = "ChartArea3"; + chartMid.ChartAreas.Add(chartArea3); chartMid.Dock = DockStyle.Fill; chartMid.Location = new Point(2, 690); chartMid.Margin = new Padding(2, 10, 2, 10); @@ -248,8 +248,8 @@ namespace GHelper chartMid.Size = new Size(760, 322); chartMid.TabIndex = 14; chartMid.Text = "chartMid"; - title15.Name = "Title3"; - chartMid.Titles.Add(title15); + title3.Name = "Title3"; + chartMid.Titles.Add(title3); chartMid.Visible = false; // // labelFans @@ -505,6 +505,100 @@ namespace GHelper panelGPU.Size = new Size(523, 634); panelGPU.TabIndex = 44; // + // panelGPUTemp + // + panelGPUTemp.AutoSize = true; + panelGPUTemp.AutoSizeMode = AutoSizeMode.GrowAndShrink; + panelGPUTemp.Controls.Add(labelGPUTemp); + panelGPUTemp.Controls.Add(labelGPUTempTitle); + panelGPUTemp.Controls.Add(trackGPUTemp); + panelGPUTemp.Dock = DockStyle.Top; + panelGPUTemp.Location = new Point(0, 485); + panelGPUTemp.Name = "panelGPUTemp"; + panelGPUTemp.Size = new Size(523, 149); + panelGPUTemp.TabIndex = 47; + // + // labelGPUTemp + // + labelGPUTemp.Anchor = AnchorStyles.Top | AnchorStyles.Right; + labelGPUTemp.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); + labelGPUTemp.Location = new Point(378, 14); + labelGPUTemp.Name = "labelGPUTemp"; + labelGPUTemp.Size = new Size(130, 32); + labelGPUTemp.TabIndex = 44; + labelGPUTemp.Text = "87C"; + labelGPUTemp.TextAlign = ContentAlignment.TopRight; + // + // labelGPUTempTitle + // + labelGPUTempTitle.AutoSize = true; + labelGPUTempTitle.Location = new Point(10, 14); + labelGPUTempTitle.Name = "labelGPUTempTitle"; + labelGPUTempTitle.Size = new Size(173, 32); + labelGPUTempTitle.TabIndex = 43; + labelGPUTempTitle.Text = "Thermal Target"; + // + // trackGPUTemp + // + trackGPUTemp.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + trackGPUTemp.Location = new Point(6, 57); + trackGPUTemp.Margin = new Padding(4, 2, 4, 2); + trackGPUTemp.Maximum = 87; + trackGPUTemp.Minimum = 75; + trackGPUTemp.Name = "trackGPUTemp"; + trackGPUTemp.Size = new Size(502, 90); + trackGPUTemp.TabIndex = 42; + trackGPUTemp.TickFrequency = 5; + trackGPUTemp.TickStyle = TickStyle.TopLeft; + trackGPUTemp.Value = 87; + // + // panelGPUBoost + // + panelGPUBoost.AutoSize = true; + panelGPUBoost.AutoSizeMode = AutoSizeMode.GrowAndShrink; + panelGPUBoost.Controls.Add(labelGPUBoost); + panelGPUBoost.Controls.Add(labelGPUBoostTitle); + panelGPUBoost.Controls.Add(trackGPUBoost); + panelGPUBoost.Dock = DockStyle.Top; + panelGPUBoost.Location = new Point(0, 345); + panelGPUBoost.Name = "panelGPUBoost"; + panelGPUBoost.Size = new Size(523, 140); + panelGPUBoost.TabIndex = 46; + // + // labelGPUBoost + // + labelGPUBoost.Anchor = AnchorStyles.Top | AnchorStyles.Right; + labelGPUBoost.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); + labelGPUBoost.Location = new Point(374, 14); + labelGPUBoost.Name = "labelGPUBoost"; + labelGPUBoost.Size = new Size(130, 32); + labelGPUBoost.TabIndex = 44; + labelGPUBoost.Text = "25W"; + labelGPUBoost.TextAlign = ContentAlignment.TopRight; + // + // labelGPUBoostTitle + // + labelGPUBoostTitle.AutoSize = true; + labelGPUBoostTitle.Location = new Point(10, 14); + labelGPUBoostTitle.Name = "labelGPUBoostTitle"; + labelGPUBoostTitle.Size = new Size(174, 32); + labelGPUBoostTitle.TabIndex = 43; + labelGPUBoostTitle.Text = "Dynamic Boost"; + // + // trackGPUBoost + // + trackGPUBoost.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + trackGPUBoost.Location = new Point(6, 48); + trackGPUBoost.Margin = new Padding(4, 2, 4, 2); + trackGPUBoost.Maximum = 25; + trackGPUBoost.Minimum = 5; + trackGPUBoost.Name = "trackGPUBoost"; + trackGPUBoost.Size = new Size(502, 90); + trackGPUBoost.TabIndex = 42; + trackGPUBoost.TickFrequency = 5; + trackGPUBoost.TickStyle = TickStyle.TopLeft; + trackGPUBoost.Value = 25; + // // panelGPUMemory // panelGPUMemory.AutoSize = true; @@ -534,20 +628,20 @@ namespace GHelper labelGPUMemoryTitle.AutoSize = true; labelGPUMemoryTitle.Location = new Point(10, 14); labelGPUMemoryTitle.Name = "labelGPUMemoryTitle"; - labelGPUMemoryTitle.Size = new Size(169, 32); + labelGPUMemoryTitle.Size = new Size(241, 32); labelGPUMemoryTitle.TabIndex = 43; labelGPUMemoryTitle.Text = "Memory Clock Offset"; // // trackGPUMemory // trackGPUMemory.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; - trackGPUMemory.LargeChange = 100; + trackGPUMemory.LargeChange = 50; trackGPUMemory.Location = new Point(6, 48); trackGPUMemory.Margin = new Padding(4, 2, 4, 2); - trackGPUMemory.Maximum = 300; + trackGPUMemory.Maximum = 250; + trackGPUMemory.Minimum = -250; trackGPUMemory.Name = "trackGPUMemory"; trackGPUMemory.Size = new Size(502, 90); - trackGPUMemory.SmallChange = 10; trackGPUMemory.TabIndex = 42; trackGPUMemory.TickFrequency = 50; trackGPUMemory.TickStyle = TickStyle.TopLeft; @@ -579,14 +673,14 @@ namespace GHelper // trackGPUCore // trackGPUCore.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; - trackGPUCore.LargeChange = 100; + trackGPUCore.LargeChange = 50; trackGPUCore.Location = new Point(6, 47); trackGPUCore.Margin = new Padding(4, 2, 4, 2); - trackGPUCore.Maximum = 300; + trackGPUCore.Maximum = 250; + trackGPUCore.Minimum = -250; trackGPUCore.Name = "trackGPUCore"; trackGPUCore.RightToLeft = RightToLeft.No; trackGPUCore.Size = new Size(502, 90); - trackGPUCore.SmallChange = 10; trackGPUCore.TabIndex = 18; trackGPUCore.TickFrequency = 50; trackGPUCore.TickStyle = TickStyle.TopLeft; @@ -636,100 +730,6 @@ namespace GHelper labelGPU.TabIndex = 40; labelGPU.Text = "GPU Settings"; // - // panelGPUBoost - // - panelGPUBoost.AutoSize = true; - panelGPUBoost.AutoSizeMode = AutoSizeMode.GrowAndShrink; - panelGPUBoost.Controls.Add(labelGPUBoost); - panelGPUBoost.Controls.Add(labelGPUBoostTitle); - panelGPUBoost.Controls.Add(trackGPUBoost); - panelGPUBoost.Dock = DockStyle.Top; - panelGPUBoost.Location = new Point(0, 345); - panelGPUBoost.Name = "panelGPUBoost"; - panelGPUBoost.Size = new Size(523, 140); - panelGPUBoost.TabIndex = 46; - // - // labelGPUBoost - // - labelGPUBoost.Anchor = AnchorStyles.Top | AnchorStyles.Right; - labelGPUBoost.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); - labelGPUBoost.Location = new Point(374, 14); - labelGPUBoost.Name = "labelGPUBoost"; - labelGPUBoost.Size = new Size(130, 32); - labelGPUBoost.TabIndex = 44; - labelGPUBoost.Text = "25W"; - labelGPUBoost.TextAlign = ContentAlignment.TopRight; - // - // labelGPUBoostTitle - // - labelGPUBoostTitle.AutoSize = true; - labelGPUBoostTitle.Location = new Point(10, 14); - labelGPUBoostTitle.Name = "labelGPUBoostTitle"; - labelGPUBoostTitle.Size = new Size(174, 32); - labelGPUBoostTitle.TabIndex = 43; - labelGPUBoostTitle.Text = "Dynamic Boost"; - // - // trackGPUBoost - // - trackGPUBoost.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; - trackGPUBoost.Location = new Point(6, 48); - trackGPUBoost.Margin = new Padding(4, 2, 4, 2); - trackGPUBoost.Maximum = 25; - trackGPUBoost.Minimum = 5; - trackGPUBoost.Name = "trackGPUBoost"; - trackGPUBoost.Size = new Size(502, 90); - trackGPUBoost.TabIndex = 42; - trackGPUBoost.TickFrequency = 5; - trackGPUBoost.TickStyle = TickStyle.TopLeft; - trackGPUBoost.Value = 25; - // - // panelGPUTemp - // - panelGPUTemp.AutoSize = true; - panelGPUTemp.AutoSizeMode = AutoSizeMode.GrowAndShrink; - panelGPUTemp.Controls.Add(labelGPUTemp); - panelGPUTemp.Controls.Add(labelGPUTempTitle); - panelGPUTemp.Controls.Add(trackGPUTemp); - panelGPUTemp.Dock = DockStyle.Top; - panelGPUTemp.Location = new Point(0, 485); - panelGPUTemp.Name = "panelGPUTemp"; - panelGPUTemp.Size = new Size(523, 149); - panelGPUTemp.TabIndex = 47; - // - // labelGPUTemp - // - labelGPUTemp.Anchor = AnchorStyles.Top | AnchorStyles.Right; - labelGPUTemp.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); - labelGPUTemp.Location = new Point(378, 14); - labelGPUTemp.Name = "labelGPUTemp"; - labelGPUTemp.Size = new Size(130, 32); - labelGPUTemp.TabIndex = 44; - labelGPUTemp.Text = "87C"; - labelGPUTemp.TextAlign = ContentAlignment.TopRight; - // - // labelGPUTempTitle - // - labelGPUTempTitle.AutoSize = true; - labelGPUTempTitle.Location = new Point(10, 14); - labelGPUTempTitle.Name = "labelGPUTempTitle"; - labelGPUTempTitle.Size = new Size(173, 32); - labelGPUTempTitle.TabIndex = 43; - labelGPUTempTitle.Text = "Thermal Target"; - // - // trackGPUTemp - // - trackGPUTemp.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; - trackGPUTemp.Location = new Point(6, 57); - trackGPUTemp.Margin = new Padding(4, 2, 4, 2); - trackGPUTemp.Maximum = 87; - trackGPUTemp.Minimum = 75; - trackGPUTemp.Name = "trackGPUTemp"; - trackGPUTemp.Size = new Size(502, 90); - trackGPUTemp.TabIndex = 42; - trackGPUTemp.TickFrequency = 5; - trackGPUTemp.TickStyle = TickStyle.TopLeft; - trackGPUTemp.Value = 87; - // // Fans // AutoScaleDimensions = new SizeF(192F, 192F); @@ -773,6 +773,12 @@ namespace GHelper ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit(); panelGPU.ResumeLayout(false); panelGPU.PerformLayout(); + panelGPUTemp.ResumeLayout(false); + panelGPUTemp.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)trackGPUTemp).EndInit(); + panelGPUBoost.ResumeLayout(false); + panelGPUBoost.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)trackGPUBoost).EndInit(); panelGPUMemory.ResumeLayout(false); panelGPUMemory.PerformLayout(); ((System.ComponentModel.ISupportInitialize)trackGPUMemory).EndInit(); @@ -782,12 +788,6 @@ namespace GHelper panelTitleGPU.ResumeLayout(false); panelTitleGPU.PerformLayout(); ((System.ComponentModel.ISupportInitialize)pictureGPU).EndInit(); - panelGPUBoost.ResumeLayout(false); - panelGPUBoost.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)trackGPUBoost).EndInit(); - panelGPUTemp.ResumeLayout(false); - panelGPUTemp.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)trackGPUTemp).EndInit(); ResumeLayout(false); } diff --git a/app/Fans.cs b/app/Fans.cs index 4217fdf2..b7580988 100644 --- a/app/Fans.cs +++ b/app/Fans.cs @@ -15,6 +15,8 @@ namespace GHelper static int MinRPM, MaxRPM; + NvidiaGpuControl? nvControl = null; + public Fans() { @@ -35,7 +37,7 @@ namespace GHelper InitTheme(); MinRPM = 18; - MaxRPM = HardwareMonitor.GetFanMax(); + MaxRPM = HardwareControl.GetFanMax(); labelTip.Visible = false; labelTip.BackColor = Color.Transparent; @@ -89,8 +91,9 @@ namespace GHelper trackGPUCore.Scroll += trackGPU_Scroll; trackGPUMemory.Scroll += trackGPU_Scroll; - trackGPUBoost.Scroll += trackGPU_Scroll; - trackGPUTemp.Scroll += trackGPU_Scroll; + + trackGPUBoost.Scroll += trackGPUPower_Scroll; + trackGPUTemp.Scroll += trackGPUPower_Scroll; trackGPUCore.MouseUp += TrackGPU_MouseUp; trackGPUMemory.MouseUp += TrackGPU_MouseUp; @@ -110,7 +113,7 @@ namespace GHelper Shown += Fans_Shown; - InitGPUClocks(); + InitGPUControl(); } @@ -128,7 +131,7 @@ namespace GHelper Program.config.setConfig("gpu_core", trackGPUCore.Value); Program.config.setConfig("gpu_memory", trackGPUMemory.Value); - int status = Program.nvControl.SetClocks(trackGPUCore.Value, trackGPUMemory.Value); + int status = nvControl.SetClocks(trackGPUCore.Value, trackGPUMemory.Value); if (status == -1) Program.RunAsAdmin("gpu"); } catch (Exception ex) @@ -136,12 +139,16 @@ namespace GHelper Logger.WriteLine("F:" + ex.ToString()); } - InitGPUClocks(); + InitGPUControl(); } - private void InitGPUClocks() + private void InitGPUControl() { - if (Program.nvControl is null || !Program.nvControl.IsValid) + if (HardwareControl.GpuControl is not null && HardwareControl.GpuControl.IsNvidia) + { + nvControl = (NvidiaGpuControl)HardwareControl.GpuControl; + } + else { panelGPU.Visible = false; return; @@ -151,9 +158,11 @@ namespace GHelper { panelGPU.Visible = true; - Program.nvControl.GetClocks(out int core, out int memory); + nvControl.GetClocks(out int core, out int memory, out string gpuTitle); + trackGPUCore.Value = Math.Max(Math.Min(core, NvidiaGpuControl.MaxCoreOffset), NvidiaGpuControl.MinCoreOffset); trackGPUMemory.Value = Math.Max(Math.Min(memory, NvidiaGpuControl.MaxMemoryOffset), NvidiaGpuControl.MinMemoryOffset); + labelGPU.Text = gpuTitle; int gpu_boost = Program.config.getConfig("gpu_boost"); int gpu_temp = Program.config.getConfig("gpu_temp"); @@ -187,6 +196,16 @@ namespace GHelper } private void trackGPU_Scroll(object? sender, EventArgs e) + { + if (sender is null) return; + + TrackBar track = (TrackBar)sender; + track.Value = (int)Math.Round((float)track.Value / 5) * 5; + VisualiseGPUSettings(); + + } + + private void trackGPUPower_Scroll(object? sender, EventArgs e) { VisualiseGPUSettings(); } @@ -342,7 +361,7 @@ namespace GHelper bool cpuBmode = (Program.wmi.DeviceGet(ASUSWmi.PPT_CPUB0) >= 0); // 2022 model + bool cpuAmode = (Program.wmi.DeviceGet(ASUSWmi.PPT_TotalA0) >= 0); // 2021 model + - panelSliders.Visible = cpuAmode; + panelPower.Visible = cpuAmode; panelCPU.Visible = cpuBmode; // Yes, that's stupid, but Total slider on 2021 model actually adjusts CPU PPT @@ -487,6 +506,14 @@ namespace GHelper checkApplyFans.Checked = false; checkApplyPower.Checked = false; + trackGPUCore.Value = 0; + trackGPUMemory.Value = 0; + trackGPUBoost.Value = ASUSWmi.MaxGPUBoost; + trackGPUTemp.Value = ASUSWmi.MaxGPUTemp; + + Program.config.setConfig("gpu_core", ASUSWmi.MaxGPUBoost); + Program.config.setConfig("gpu_memory", ASUSWmi.MaxGPUTemp); + Program.config.setConfigPerf("auto_apply", 0); Program.config.setConfigPerf("auto_apply_power", 0); diff --git a/app/GHelper.csproj b/app/GHelper.csproj index 6d225211..120aca26 100644 --- a/app/GHelper.csproj +++ b/app/GHelper.csproj @@ -16,7 +16,7 @@ AnyCPU False True - 0.58 + 0.59 diff --git a/app/Gpu/IGpuControl.cs b/app/Gpu/IGpuControl.cs index f54a7725..cd7d6639 100644 --- a/app/Gpu/IGpuControl.cs +++ b/app/Gpu/IGpuControl.cs @@ -1,6 +1,6 @@ namespace GHelper.Gpu; -public interface IGpuControl : IDisposable { +public interface IGpuControl : IDisposable { bool IsNvidia { get; } bool IsValid { get; } int? GetCurrentTemperature(); diff --git a/app/Gpu/NvidiaGpuControl.cs b/app/Gpu/NvidiaGpuControl.cs index 0a351be7..bbb5ce00 100644 --- a/app/Gpu/NvidiaGpuControl.cs +++ b/app/Gpu/NvidiaGpuControl.cs @@ -3,6 +3,7 @@ using NvAPIWrapper.Native; using NvAPIWrapper.Native.GPU; using NvAPIWrapper.Native.GPU.Structures; using NvAPIWrapper.Native.Interfaces.GPU; +using System.Diagnostics; using static NvAPIWrapper.Native.GPU.Structures.PerformanceStates20InfoV1; namespace GHelper.Gpu; @@ -16,11 +17,36 @@ public class NvidiaGpuControl : IGpuControl public const int MinCoreOffset = -250; public const int MinMemoryOffset = -250; - private readonly PhysicalGPU? _internalGpu; + private static PhysicalGPU? _internalGpu; public NvidiaGpuControl() { - _internalGpu = GetInternalDiscreteGpu(); + Create(); + } + + + public static void Create() + { + try + { + _internalGpu = GetInternalDiscreteGpu(); + } + catch (Exception ex) + { + Debug.WriteLine(ex); + _internalGpu = null; + } + } + + + public static void RecreateWithDelay(int delay = 5) + { + Task.Run(async () => + { + await Task.Delay(TimeSpan.FromSeconds(delay)); + Create(); + }); + } public bool IsValid => _internalGpu != null; @@ -46,9 +72,12 @@ public class NvidiaGpuControl : IGpuControl - public void GetClocks(out int core, out int memory) + public void GetClocks(out int core, out int memory, out string gpu) { PhysicalGPU internalGpu = _internalGpu!; + + gpu = internalGpu.FullName; + Logger.WriteLine(internalGpu.FullName); Logger.WriteLine(internalGpu.ArchitectInformation.ToString()); @@ -96,7 +125,7 @@ public class NvidiaGpuControl : IGpuControl } catch (Exception ex) { - Logger.WriteLine(ex.ToString()); + Logger.WriteLine(ex.Message); return -1; } diff --git a/app/HardwareMonitor.cs b/app/HardwareControl.cs similarity index 93% rename from app/HardwareMonitor.cs rename to app/HardwareControl.cs index 15eb5f3b..6d5fe661 100644 --- a/app/HardwareMonitor.cs +++ b/app/HardwareControl.cs @@ -2,7 +2,7 @@ using GHelper.Gpu; using System.Diagnostics; -public static class HardwareMonitor +public static class HardwareControl { public static IGpuControl? GpuControl; @@ -124,9 +124,8 @@ public static class HardwareMonitor return false; } - public static void RecreateGpuControlWithDelay(int delay = 5) + public static void RecreateGpuControlWithDelay(int delay = 3) { - // Re-enabling the discrete GPU takes a bit of time, // so a simple workaround is to refresh again after that happens Task.Run(async () => @@ -134,9 +133,6 @@ public static class HardwareMonitor await Task.Delay(TimeSpan.FromSeconds(delay)); RecreateGpuControl(); }); - - - } public static void RecreateGpuControl() @@ -145,8 +141,6 @@ public static class HardwareMonitor { GpuControl?.Dispose(); - // Detect valid GPU temperature provider. - // We start with NVIDIA because there's always at least an integrated AMD GPU IGpuControl _gpuControl = new NvidiaGpuControl(); if (_gpuControl.IsValid) { @@ -156,7 +150,6 @@ public static class HardwareMonitor _gpuControl.Dispose(); - /* _gpuControl = new AmdGpuControl(); if (_gpuControl.IsValid) { @@ -164,7 +157,6 @@ public static class HardwareMonitor return; } _gpuControl.Dispose(); - */ GpuControl = null; } diff --git a/app/NvAPIWrapper/DRS/DriverSettingsProfile.cs b/app/NvAPIWrapper/DRS/DriverSettingsProfile.cs deleted file mode 100644 index 0fc24c4b..00000000 --- a/app/NvAPIWrapper/DRS/DriverSettingsProfile.cs +++ /dev/null @@ -1,481 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using NvAPIWrapper.Native; -using NvAPIWrapper.Native.DRS; -using NvAPIWrapper.Native.DRS.Structures; - -namespace NvAPIWrapper.DRS -{ - /// - /// Represents a NVIDIA driver settings profile - /// - public class DriverSettingsProfile - { - internal DriverSettingsProfile(DRSProfileHandle handle, DriverSettingsSession parentSession) - { - Handle = handle; - Session = parentSession; - } - - /// - /// Gets a list of applications under this profile - /// - public IEnumerable Applications - { - get - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid profile instance." - ); - } - - return DRSApi.EnumApplications(Session.Handle, Handle) - .Select(application => new ProfileApplication(application, this)); - } - } - - /// - /// Gets or sets the profile support value for GPU series - /// - public DRSGPUSupport GPUSupport - { - get - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid profile instance." - ); - } - - var profileInfo = DRSApi.GetProfileInfo(Session.Handle, Handle); - - return profileInfo.GPUSupport; - } - set - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid profile instance." - ); - } - - var profileInfo = DRSApi.GetProfileInfo(Session.Handle, Handle); - profileInfo.GPUSupport = value; - DRSApi.SetProfileInfo(Session.Handle, Handle, profileInfo); - } - } - - /// - /// Gets the profile handle - /// - public DRSProfileHandle Handle { get; private set; } - - /// - /// Gets a boolean value indicating if this profile is predefined - /// - public bool IsPredefined - { - get - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid profile instance." - ); - } - - var profileInfo = DRSApi.GetProfileInfo(Session.Handle, Handle); - - return profileInfo.IsPredefined; - } - } - - /// - /// Gets a boolean value indicating if this profile is valid and contains a non-zero handle - /// - public bool IsValid - { - get => !Handle.IsNull; - } - - /// - /// Gets the name of the profile - /// - public string Name - { - get - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid profile instance." - ); - } - - var profileInfo = DRSApi.GetProfileInfo(Session.Handle, Handle); - - return profileInfo.Name; - } - } - - /// - /// Gets the number of application registered under this profile - /// - public int NumberOfApplications - { - get - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid profile instance." - ); - } - - var profileInfo = DRSApi.GetProfileInfo(Session.Handle, Handle); - - return profileInfo.NumberOfApplications; - } - } - - /// - /// Gets the number of settings under this profile - /// - public int NumberOfSettings - { - get - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid profile instance." - ); - } - - var profileInfo = DRSApi.GetProfileInfo(Session.Handle, Handle); - - return profileInfo.NumberOfSettings; - } - } - - /// - /// Gets the session that had queried this profile - /// - public DriverSettingsSession Session { get; } - - /// - /// Gets a list of settings under this profile - /// - public IEnumerable Settings - { - get - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid profile instance." - ); - } - - return DRSApi.EnumSettings(Session.Handle, Handle).Select(setting => new ProfileSetting(setting)); - } - } - - /// - /// Creates a new profile - /// - /// The session to create this profile in. - /// The name of the profile. - /// The supported GPU series for this profile. - /// An instance of representing this newly created profile. - public static DriverSettingsProfile CreateProfile( - DriverSettingsSession session, - string profileName, - DRSGPUSupport? gpuSupport = null) - { - gpuSupport = gpuSupport ?? new DRSGPUSupport(); - var profileInfo = new DRSProfileV1(profileName, gpuSupport.Value); - var profileHandle = DRSApi.CreateProfile(session.Handle, profileInfo); - - return new DriverSettingsProfile(profileHandle, session); - } - - /// - public override string ToString() - { - if (!IsValid) - { - return "[Invalid]"; - } - - if (IsPredefined) - { - return $"{Name} (Predefined)"; - } - - return Name; - } - - /// - /// Deletes this profile and makes this instance invalid. - /// - public void Delete() - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid profile instance." - ); - } - - DRSApi.DeleteProfile(Session.Handle, Handle); - Handle = DRSProfileHandle.DefaultHandle; - } - - /// - /// Deletes an application by its name. - /// - /// The name of the application to be deleted. - public void DeleteApplicationByName(string applicationName) - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid profile instance." - ); - } - - DRSApi.DeleteApplication(Session.Handle, Handle, applicationName); - } - - /// - /// Deletes a setting by its identification number - /// - /// The identification number of the setting to be deleted. - public void DeleteSetting(uint settingId) - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid profile instance." - ); - } - - DRSApi.DeleteProfileSetting(Session.Handle, Handle, settingId); - } - - /// - /// Deletes a setting by its known identification number. - /// - /// The known identification number of the setting to be deleted. - public void DeleteSetting(KnownSettingId settingId) - { - DeleteSetting(SettingInfo.GetSettingId(settingId)); - } - - /// - /// Finds an application by its name. - /// - /// The name of the application to search for. - /// - /// An instance of if an application is found; otherwise - /// . - /// - public ProfileApplication GetApplicationByName(string applicationName) - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid profile instance." - ); - } - - var application = DRSApi.GetApplicationInfo(Session.Handle, Handle, applicationName); - - if (application == null) - { - return null; - } - - return new ProfileApplication(application, this); - } - - /// - /// Searches for a setting using its identification number. - /// - /// The identification number of the setting to search for. - /// An instance of if a setting is found; otherwise . - public ProfileSetting GetSetting(uint settingId) - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid profile instance." - ); - } - - var setting = DRSApi.GetSetting(Session.Handle, Handle, settingId); - - if (setting == null) - { - return null; - } - - return new ProfileSetting(setting.Value); - } - - - /// - /// Searches for a setting using its known identification number. - /// - /// The known identification number of the setting to search for. - /// An instance of if a setting is found; otherwise . - public ProfileSetting GetSetting(KnownSettingId settingId) - { - return GetSetting(SettingInfo.GetSettingId(settingId)); - } - - /// - /// Restores applications and settings of this profile to their default. This also deletes custom profiles resulting in - /// their handles becoming invalid. - /// - public void RestoreDefaults() - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid profile instance." - ); - } - - var isPredefined = IsPredefined; - DRSApi.RestoreDefaults(Session.Handle, Handle); - - if (!isPredefined) - { - Handle = DRSProfileHandle.DefaultHandle; - } - } - - /// - /// Restores a setting to its default value. - /// - /// The identification number of the setting. - public void RestoreSettingToDefault(uint settingId) - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid profile instance." - ); - } - - DRSApi.RestoreDefaults(Session.Handle, Handle, settingId); - } - - /// - /// Restores a setting to its default value. - /// - /// The known identification number of the setting. - public void RestoreSettingToDefault(KnownSettingId settingId) - { - RestoreSettingToDefault(SettingInfo.GetSettingId(settingId)); - } - - /// - /// Sets a new value for a setting or creates a new setting and sets its value - /// - /// The known identification number of the setting to change its value. - /// The type of the setting value. - /// The new value for the setting. - public void SetSetting(KnownSettingId settingId, DRSSettingType settingType, object value) - { - SetSetting(SettingInfo.GetSettingId(settingId), settingType, value); - } - - /// - /// Sets a new value for a setting or creates a new setting and sets its value - /// - /// The known identification number of the setting to change its value. - /// The new value for the setting. - public void SetSetting(KnownSettingId settingId, string value) - { - SetSetting(SettingInfo.GetSettingId(settingId), value); - } - - /// - /// Sets a new value for a setting or creates a new setting and sets its value - /// - /// The known identification number of the setting to change its value. - /// The new value for the setting. - public void SetSetting(KnownSettingId settingId, byte[] value) - { - SetSetting(SettingInfo.GetSettingId(settingId), value); - } - - /// - /// Sets a new value for a setting or creates a new setting and sets its value - /// - /// The known identification number of the setting to change its value. - /// The new value for the setting. - public void SetSetting(KnownSettingId settingId, uint value) - { - SetSetting(SettingInfo.GetSettingId(settingId), value); - } - - /// - /// Sets a new value for a setting or creates a new setting and sets its value - /// - /// The identification number of the setting to change its value. - /// The type of the setting value. - /// The new value for the setting. - public void SetSetting(uint settingId, DRSSettingType settingType, object value) - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid profile instance." - ); - } - - var setting = new DRSSettingV1(settingId, settingType, value); - - DRSApi.SetSetting(Session.Handle, Handle, setting); - } - - /// - /// Sets a new value for a setting or creates a new setting and sets its value - /// - /// The identification number of the setting to change its value. - /// The new value for the setting. - public void SetSetting(uint settingId, string value) - { - SetSetting(settingId, DRSSettingType.UnicodeString, value); - } - - /// - /// Sets a new value for a setting or creates a new setting and sets its value - /// - /// The identification number of the setting to change its value. - /// The new value for the setting. - public void SetSetting(uint settingId, byte[] value) - { - SetSetting(settingId, DRSSettingType.Binary, value); - } - - /// - /// Sets a new value for a setting or creates a new setting and sets its value - /// - /// The identification number of the setting to change its value. - /// The new value for the setting. - public void SetSetting(uint settingId, uint value) - { - SetSetting(settingId, DRSSettingType.Integer, value); - } - } -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/DriverSettingsSession.cs b/app/NvAPIWrapper/DRS/DriverSettingsSession.cs deleted file mode 100644 index ce8ed6a1..00000000 --- a/app/NvAPIWrapper/DRS/DriverSettingsSession.cs +++ /dev/null @@ -1,236 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using NvAPIWrapper.Native; -using NvAPIWrapper.Native.DRS.Structures; - -namespace NvAPIWrapper.DRS -{ - /// - /// Represents a driver settings session. This is the starting point for using DRS set of functionalities. - /// - public class DriverSettingsSession : IDisposable - { - internal DriverSettingsSession(DRSSessionHandle handle) - { - Handle = handle; - } - - private DriverSettingsSession() : this(DRSApi.CreateSession()) - { - } - - /// - /// Gets the base settings profile - /// - public DriverSettingsProfile BaseProfile - { - get - { - var profileHandle = DRSApi.GetBaseProfile(Handle); - - if (profileHandle.IsNull) - { - return null; - } - - return new DriverSettingsProfile(profileHandle, this); - } - } - - /// - /// Gets the global settings profile - /// - public DriverSettingsProfile CurrentGlobalProfile - { - get - { - var profileHandle = DRSApi.GetCurrentGlobalProfile(Handle); - - if (profileHandle.IsNull) - { - return null; - } - - return new DriverSettingsProfile(profileHandle, this); - } - set - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - if (string.IsNullOrEmpty(value.Name)) - { - throw new ArgumentException("Profile name can not be empty.", nameof(value)); - } - - DRSApi.SetCurrentGlobalProfile(Handle, value.Name); - } - } - - /// - /// Gets the session handle - /// - public DRSSessionHandle Handle { get; } - - /// - /// Gets the number of registered profiles - /// - public int NumberOfProfiles - { - get => DRSApi.GetNumberOfProfiles(Handle); - } - - /// - /// Gets the list of all registered profiles - /// - public IEnumerable Profiles - { - get { return DRSApi.EnumProfiles(Handle).Select(handle => new DriverSettingsProfile(handle, this)); } - } - - /// - public void Dispose() - { - ReleaseUnmanagedResources(); - GC.SuppressFinalize(this); - } - - /// - /// Creates a new session and load the settings - /// - /// A new instance of representing a session. - public static DriverSettingsSession CreateAndLoad() - { - var session = new DriverSettingsSession(); - session.Load(); - - return session; - } - - /// - /// Creates a new session and load the settings from a file - /// - /// The full path of file to load settings from. - /// A new instance of representing a session. - public static DriverSettingsSession CreateAndLoad(string fileName) - { - var session = new DriverSettingsSession(); - session.Load(fileName); - - return session; - } - - /// - public override string ToString() - { - return $"{Handle} ({NumberOfProfiles} Profiles)"; - } - - /// - /// Finds an application by name. This method is useful when passed a full path of a file as it does return an - /// application almost always describing the NVIDIA driver behavior regarding the passed executable file. - /// - /// The name of the application (with extension) or the full path of an executable file. - /// An instance of class. - public ProfileApplication FindApplication(string applicationName) - { - var application = DRSApi.FindApplicationByName(Handle, applicationName, out var profileHandle); - - if (application == null || !profileHandle.HasValue || profileHandle.Value.IsNull) - { - return null; - } - - var profile = new DriverSettingsProfile(profileHandle.Value, this); - - return new ProfileApplication(application, profile); - } - - /// - /// Finds a profile based on the application named passed. This method is useful when passed a full path of a file as - /// it does return a profile almost always describing the NVIDIA driver behavior regarding the passed executable file. - /// - /// The name of the application (with extension) or the full path of an executable file. - /// - /// An instance of class describing the NVIDIA driver behavior regarding the - /// passed executable file. - /// - public DriverSettingsProfile FindApplicationProfile(string applicationName) - { - var application = DRSApi.FindApplicationByName(Handle, applicationName, out var profileHandle); - - if (application == null || !profileHandle.HasValue || profileHandle.Value.IsNull) - { - return null; - } - - return new DriverSettingsProfile(profileHandle.Value, this); - } - - /// - /// Finds a profile based on its name. - /// - /// The profile name to search for. - /// An instance of class. - public DriverSettingsProfile FindProfileByName(string profileName) - { - var profileHandle = DRSApi.FindProfileByName(Handle, profileName); - - if (profileHandle.IsNull) - { - return null; - } - - return new DriverSettingsProfile(profileHandle, this); - } - - /// - /// Resets all settings to default. - /// - public void RestoreDefaults() - { - DRSApi.RestoreDefaults(Handle); - } - - /// - /// Saves the current session settings - /// - public void Save() - { - DRSApi.SaveSettings(Handle); - } - - /// - /// Saves the current session settings to a file - /// - /// The full path of file to save settings to. - public void Save(string fileName) - { - DRSApi.SaveSettings(Handle, fileName); - } - - private void Load() - { - DRSApi.LoadSettings(Handle); - } - - private void Load(string fileName) - { - DRSApi.LoadSettings(Handle, fileName); - } - - private void ReleaseUnmanagedResources() - { - DRSApi.DestroySession(Handle); - } - - /// - ~DriverSettingsSession() - { - ReleaseUnmanagedResources(); - } - } -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/KnownSettingId.cs b/app/NvAPIWrapper/DRS/KnownSettingId.cs deleted file mode 100644 index 021ec6d7..00000000 --- a/app/NvAPIWrapper/DRS/KnownSettingId.cs +++ /dev/null @@ -1,555 +0,0 @@ -using System.ComponentModel; - -namespace NvAPIWrapper.DRS -{ -#pragma warning disable 1591 - public enum KnownSettingId : uint - { - /// - /// Antialiasing - Line gamma - /// - [Description("Antialiasing - Line gamma")] - OpenGLAntiAliasingLineGamma = 0x2089BF6C, - - /// - /// Deep color for 3D applications - /// - [Description("Deep color for 3D applications")] - OpenGLDeepColorScanOut = 0x2097C2F6, - - /// - /// OpenGL default swap interval - /// - [Description("OpenGL default swap interval")] - OpenGLDefaultSwapInterval = 0x206A6582, - - /// - /// OpenGL default swap interval fraction - /// - [Description("OpenGL default swap interval fraction")] - OpenGLDefaultSwapIntervalFractional = 0x206C4581, - - /// - /// OpenGL default swap interval sign - /// - [Description("OpenGL default swap interval sign")] - OpenGLDefaultSwapIntervalSign = 0x20655CFA, - - /// - /// Event Log Severity Threshold - /// - [Description("Event Log Severity Threshold")] - OpenGLEventLogSeverityThreshold = 0x209DF23E, - - /// - /// Extension String version - /// - [Description("Extension String version")] - OpenGLExtensionStringVersion = 0x20FF7493, - - /// - /// Buffer-flipping mode - /// - [Description("Buffer-flipping mode")] OpenGLForceBlit = 0x201F619F, - - /// - /// Force Stereo shuttering - /// - [Description("Force Stereo shuttering")] - OpenGLForceStereo = 0x204D9A0C, - - /// - /// Preferred OpenGL GPU - /// - [Description("Preferred OpenGL GPU")] OpenGLImplicitGPUAffinity = 0x20D0F3E6, - - /// - /// Maximum frames allowed - /// - [Description("Maximum frames allowed")] - OpenGLMaximumFramesAllowed = 0x208E55E3, - - /// - /// Exported Overlay pixel types - /// - [Description("Exported Overlay pixel types")] - OpenGLOverlayPixelType = 0x209AE66F, - - /// - /// Enable overlay - /// - [Description("Enable overlay")] OpenGLOverlaySupport = 0x206C28C4, - - /// - /// High level control of the rendering quality on OpenGL - /// - [Description("High level control of the rendering quality on OpenGL")] - OpenGLQualityEnhancements = 0x20797D6C, - - /// - /// Unified back/depth buffer - /// - [Description("Unified back/depth buffer")] - OpenGLSingleBackDepthBuffer = 0x20A29055, - - /// - /// Enable NV_gpu_multicast extension - /// - [Description("Enable NV_gpu_multicast extension")] - OpenGLSLIMulticast = 0x2092D3BE, - - /// - /// Threaded optimization - /// - [Description("Threaded optimization")] OpenGLThreadControl = 0x20C1221E, - - /// - /// Event Log Tmon Severity Threshold - /// - [Description("Event Log Tmon Severity Threshold")] - OpenGLTMONLevel = 0x202888C1, - - /// - /// Triple buffering - /// - [Description("Triple buffering")] OpenGLTripleBuffer = 0x20FDD1F9, - - /// - /// Antialiasing - Behavior Flags - /// - [Description("Antialiasing - Behavior Flags")] - AntiAliasingBehaviorFlags = 0x10ECDB82, - - /// - /// Antialiasing - Transparency Multisampling - /// - [Description("Antialiasing - Transparency Multisampling")] - AntiAliasingModeAlphaToCoverage = 0x10FC2D9C, - - /// - /// Antialiasing - Gamma correction - /// - [Description("Antialiasing - Gamma correction")] - AntiAliasingModeGammaCorrection = 0x107D639D, - - /// - /// Antialiasing - Setting - /// - [Description("Antialiasing - Setting")] - AntiAliasingModeMethod = 0x10D773D2, - - /// - /// Antialiasing - Transparency Supersampling - /// - [Description("Antialiasing - Transparency Supersampling")] - AntiAliasingModeReplay = 0x10D48A85, - - /// - /// Antialiasing - Mode - /// - [Description("Antialiasing - Mode")] AntiAliasingModeSelector = 0x107EFC5B, - - /// - /// Antialiasing - SLI AA - /// - [Description("Antialiasing - SLI AA")] AntiAliasingModeSelectorSLIAntiAliasing = 0x107AFC5B, - - /// - /// Anisotropic filtering setting - /// - [Description("Anisotropic filtering setting")] - AnisotropicModeLevel = 0x101E61A9, - - /// - /// Anisotropic filtering mode - /// - [Description("Anisotropic filtering mode")] - AnisotropicModeSelector = 0x10D2BB16, - - /// - /// NVIDIA Predefined Ansel Usage - /// - [Description("NVIDIA Predefined Ansel Usage")] - AnselAllow = 0x1035DB89, - - /// - /// Enable Ansel - /// - [Description("Enable Ansel")] AnselEnable = 0x1075D972, - - /// - /// Ansel flags for enabled applications - /// - [Description("Ansel flags for enabled applications")] - AnselWhiteListed = 0x1085DA8A, - - /// - /// Application Profile Notification Popup Timeout - /// - [Description("Application Profile Notification Popup Timeout")] - ApplicationProfileNotificationTimeOut = 0x104554B6, - - /// - /// Steam Application ID - /// - [Description("Steam Application ID")] ApplicationSteamId = 0x107CDDBC, - - /// - /// Battery Boost - /// - [Description("Battery Boost")] BatteryBoost = 0x10115C89, - - /// - /// Do not display this profile in the Control Panel - /// - [Description("Do not display this profile in the Control Panel")] - ControlPanelHiddenProfile = 0x106D5CFF, - - /// - /// List of Universal GPU ids - /// - [Description("List of Universal GPU ids")] - CUDAExcludedGPUs = 0x10354FF8, - - /// - /// Maximum GPU Power - /// - [Description("Maximum GPU Power")] D3DOpenGLGPUMaximumPower = 0x10D1EF29, - - /// - /// Export Performance Counters - /// - [Description("Export Performance Counters")] - ExportPerformanceCounters = 0x108F0841, - - /// - /// NVIDIA Predefined FXAA Usage - /// - [Description("NVIDIA Predefined FXAA Usage")] - FXAAAllow = 0x1034CB89, - - /// - /// Enable FXAA - /// - [Description("Enable FXAA")] FXAAEnable = 0x1074C972, - - /// - /// Enable FXAA Indicator - /// - [Description("Enable FXAA Indicator")] FXAAIndicatorEnable = 0x1068FB9C, - - /// - /// SLI indicator - /// - [Description("SLI indicator")] MCSFRShowSplit = 0x10287051, - - /// - /// NVIDIA Quality upscaling - /// - [Description("NVIDIA Quality upscaling")] - NvidiaQualityUpScaling = 0x10444444, - - /// - /// Maximum AA samples allowed for a given application - /// - [Description("Maximum AA samples allowed for a given application")] - OptimusMaximumAntiAliasing = 0x10F9DC83, - - /// - /// Display the PhysX indicator - /// - [Description("Display the PhysX indicator")] - PhysxIndicator = 0x1094F16F, - - /// - /// Power management mode - /// - [Description("Power management mode")] PreferredPerformanceState = 0x1057EB71, - - /// - /// No override of Anisotropic filtering - /// - [Description("No override of Anisotropic filtering")] - PreventUiAnisotropicOverride = 0x103BCCB5, - - /// - /// Frame Rate Limiter - /// - [Description("Frame Rate Limiter")] PerformanceStateFrameRateLimiter = 0x10834FEE, - - /// - /// Frame Rate Limiter 2 Control - /// - [Description("Frame Rate Limiter 2 Control")] - PerformanceStateFrameRateLimiter2Control = 0x10834FFF, - - /// - /// Frame Rate Monitor - /// - [Description("Frame Rate Monitor")] PerformanceStateFrameRateLimiterGpsControl = 0x10834F01, - - /// - /// Frame Rate Monitor Control - /// - [Description("Frame Rate Monitor Control")] - PerformanceStateFrameRateMonitorControl = 0x10834F05, - - /// - /// Maximum resolution allowed for a given application - /// - [Description("Maximum resolution allowed for a given application")] - ShimMaxResolution = 0x10F9DC82, - - /// - /// Optimus flags for enabled applications - /// - [Description("Optimus flags for enabled applications")] - ShimMCCOMPAT = 0x10F9DC80, - - /// - /// Enable application for Optimus - /// - [Description("Enable application for Optimus")] - ShimRenderingMode = 0x10F9DC81, - - /// - /// Shim Rendering Mode Options per application for Optimus - /// - [Description("Shim Rendering Mode Options per application for Optimus")] - ShimRenderingOptions = 0x10F9DC84, - - /// - /// Number of GPUs to use on SLI rendering mode - /// - [Description("Number of GPUs to use on SLI rendering mode")] - SLIGPUCount = 0x1033DCD1, - - /// - /// NVIDIA predefined number of GPUs to use on SLI rendering mode - /// - [Description("NVIDIA predefined number of GPUs to use on SLI rendering mode")] - SLIPredefinedGPUCount = 0x1033DCD2, - - /// - /// NVIDIA predefined number of GPUs to use on SLI rendering mode on DirectX 10 - /// - [Description("NVIDIA predefined number of GPUs to use on SLI rendering mode on DirectX 10")] - SLIPredefinedGPUCountDX10 = 0x1033DCD3, - - /// - /// NVIDIA predefined SLI mode - /// - [Description("NVIDIA predefined SLI mode")] - SLIPredefinedMode = 0x1033CEC1, - - /// - /// NVIDIA predefined SLI mode on DirectX 10 - /// - [Description("NVIDIA predefined SLI mode on DirectX 10")] - SLIPredefinedModeDX10 = 0x1033CEC2, - - /// - /// SLI rendering mode - /// - [Description("SLI rendering mode")] SLIRenderingMode = 0x1033CED1, - - /// - /// Virtual Reality pre-rendered frames - /// - [Description("Virtual Reality pre-rendered frames")] - VRPreRenderLimit = 0x10111133, - - /// - /// Toggle the VRR global feature - /// - [Description("Toggle the VRR global feature")] - VRRFeatureIndicator = 0x1094F157, - - /// - /// Display the VRR Overlay Indicator - /// - [Description("Display the VRR Overlay Indicator")] - VRROverlayIndicator = 0x1095F16F, - - /// - /// VRR requested state - /// - [Description("VRR requested state")] VRRRequestState = 0x1094F1F7, - - /// - /// G-SYNC - /// - [Description("G-SYNC")] VRRApplicationOverride = 0x10A879CF, - - /// - /// G-SYNC - /// - [Description("G-SYNC")] VRRApplicationOverrideRequestState = 0x10A879AC, - - /// - /// Enable G-SYNC globally - /// - [Description("Enable G-SYNC globally")] - VRRMode = 0x1194F158, - - /// - /// Flag to control smooth AFR behavior - /// - [Description("Flag to control smooth AFR behavior")] - VSyncSmoothAFR = 0x101AE763, - - /// - /// Variable refresh Rate - /// - [Description("Variable refresh Rate")] VSyncVRRControl = 0x10A879CE, - - /// - /// Vsync - Behavior Flags - /// - [Description("Vsync - Behavior Flags")] - VSyncBehaviorFlags = 0x10FDEC23, - - /// - /// Stereo - Swap eyes - /// - [Description("Stereo - Swap eyes")] WKSAPIStereoEyesExchange = 0x11AE435C, - - /// - /// Stereo - Display mode - /// - [Description("Stereo - Display mode")] WKSAPIStereoMode = 0x11E91A61, - - /// - /// Memory Allocation Policy - /// - [Description("Memory Allocation Policy")] - WKSMemoryAllocationPolicy = 0x11112233, - - /// - /// Stereo - Dongle Support - /// - [Description("Stereo - Dongle Support")] - WKSStereoDongleSupport = 0x112493BD, - - /// - /// Stereo - Enable - /// - [Description("Stereo - Enable")] WKSStereoSupport = 0x11AA9E99, - - /// - /// Stereo � swap mode - /// - [Description("Stereo � swap mode")] WKSStereoSwapMode = 0x11333333, - - /// - /// Ambient Occlusion - /// - [Description("Ambient Occlusion")] AmbientOcclusionMode = 0x667329, - - /// - /// NVIDIA Predefined Ambient Occlusion Usage - /// - [Description("NVIDIA Predefined Ambient Occlusion Usage")] - AmbientOcclusionModeActive = 0x664339, - - /// - /// Texture filtering - Driver Controlled LOD Bias - /// - [Description("Texture filtering - Driver Controlled LOD Bias")] - AutoLODBiasAdjust = 0x638E8F, - - /// - /// Export Performance Counters for DX9 only - /// - [Description("Export Performance Counters for DX9 only")] - ExportPerformanceCountersDX9Only = 0xB65E72, - - /// - /// ICafe Settings - /// - [Description("ICafe Settings")] ICafeLogoConfig = 0xDB1337, - - /// - /// Texture filtering - LOD Bias - /// - [Description("Texture filtering - LOD Bias")] - LODBiasAdjust = 0x738E8F, - - /// - /// Enable sample interleaving (MFAA) - /// - [Description("Enable sample interleaving (MFAA)")] - MaxwellBSampleInterleave = 0x98C1AC, - - /// - /// Maximum pre-rendered frames - /// - [Description("Maximum pre-rendered frames")] - PreRenderLimit = 0x7BA09E, - - /// - /// Shader Cache - /// - [Description("Shader Cache")] PerformanceStateShaderDiskCache = 0x198FFF, - - /// - /// Texture filtering - Anisotropic sample optimization - /// - [Description("Texture filtering - Anisotropic sample optimization")] - PerformanceStateTextureFilteringAnisotropicOptimization = 0xE73211, - - /// - /// Texture filtering - Anisotropic filter optimization - /// - [Description("Texture filtering - Anisotropic filter optimization")] - PerformanceStateTextureFilteringBiLinearInAnisotropic = 0x84CD70, - - /// - /// Texture filtering - Trilinear optimization - /// - [Description("Texture filtering - Trilinear optimization")] - PerformanceStateTextureFilteringDisableTrilinearSlope = 0x2ECAF2, - - /// - /// Texture filtering - Negative LOD bias - /// - [Description("Texture filtering - Negative LOD bias")] - PerformanceStateTextureFilteringNoNegativeLODBias = 0x19BB68, - - /// - /// Texture filtering - Quality - /// - [Description("Texture filtering - Quality")] - QualityEnhancements = 0xCE2691, - - /// - /// Preferred refresh rate - /// - [Description("Preferred refresh rate")] - RefreshRateOverride = 0x64B541, - - /// - /// PowerThrottle - /// - [Description("PowerThrottle")] SetPowerThrottleForPCIeCompliance = 0xAE785C, - - /// - /// VAB Default Data - /// - [Description("VAB Default Data")] SetVABData = 0xAB8687, - - /// - /// Vertical Sync - /// - [Description("Vertical Sync")] VSyncMode = 0xA879CF, - - /// - /// Vertical Sync Tear Control - /// - [Description("Vertical Sync Tear Control")] - VSyncTearControl = 0x5A375C, - - InvalidSetting = 0xFFFFFFFF - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/ProfileApplication.cs b/app/NvAPIWrapper/DRS/ProfileApplication.cs deleted file mode 100644 index 04961b86..00000000 --- a/app/NvAPIWrapper/DRS/ProfileApplication.cs +++ /dev/null @@ -1,424 +0,0 @@ -using System; -using NvAPIWrapper.Native; -using NvAPIWrapper.Native.DRS.Structures; -using NvAPIWrapper.Native.Exceptions; -using NvAPIWrapper.Native.Interfaces.DRS; - -namespace NvAPIWrapper.DRS -{ - /// - /// Represents an application rule registered in a profile - /// - public class ProfileApplication - { - private IDRSApplication _application; - - internal ProfileApplication(IDRSApplication application, DriverSettingsProfile profile) - { - Profile = profile; - _application = application; - } - - /// - /// Gets the application name - /// - public string ApplicationName - { - get - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid application instance." - ); - } - - return _application.ApplicationName; - } - } - - /// - /// Gets the application command line - /// - public string CommandLine - { - get - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid application instance." - ); - } - - if (_application is DRSApplicationV4 applicationV4) - { - return applicationV4.ApplicationCommandLine; - } - - return null; - } - } - - /// - /// Gets a list of files that are necessary to be present inside the application parent directory - /// - public string[] FilesInFolder - { - get - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid application instance." - ); - } - - if (_application is DRSApplicationV2 applicationV2) - { - return applicationV2.FilesInFolder; - } - - if (_application is DRSApplicationV3 applicationV3) - { - return applicationV3.FilesInFolder; - } - - if (_application is DRSApplicationV4 applicationV4) - { - return applicationV4.FilesInFolder; - } - - return null; - } - } - - /// - /// Gets the application friendly name - /// - public string FriendlyName - { - get - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid application instance." - ); - } - - return _application.FriendlyName; - } - } - - /// - /// Gets a boolean value indicating if this application rule needs a specific command line; or - /// if this information is not available. - /// - public bool? HasCommandLine - { - get - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid application instance." - ); - } - - if (_application is DRSApplicationV3 applicationV3) - { - return applicationV3.HasCommandLine; - } - - if (_application is DRSApplicationV4 applicationV4) - { - return applicationV4.HasCommandLine; - } - - return null; - } - } - - /// - /// Gets a boolean value indicating if this application is a metro application; or if this - /// information is not available. - /// - public bool? IsMetroApplication - { - get - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid application instance." - ); - } - - if (_application is DRSApplicationV3 applicationV3) - { - return applicationV3.IsMetroApplication; - } - - if (_application is DRSApplicationV4 applicationV4) - { - return applicationV4.IsMetroApplication; - } - - return null; - } - } - - /// - /// Gets a boolean value indicating if this application is predefined by the NVIDIA driver - /// - public bool IsPredefined - { - get - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid application instance." - ); - } - - return _application.IsPredefined; - } - } - - /// - /// Gets a boolean value indicating if this instance of is a valid instance - /// representing an application in a profile - /// - public bool IsValid - { - get => _application != null && Profile.IsValid; - } - - /// - /// Gets the application launcher name - /// - public string LauncherName - { - get - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid application instance." - ); - } - - return _application.LauncherName; - } - } - - /// - /// Gets the parent profile instance - /// - public DriverSettingsProfile Profile { get; } - - /// - /// Creates a new application - /// - /// The profile to create the new application in. - /// The application name (with extension). - /// The application friendly name. - /// The application launcher name. - /// An array of files necessary to be present inside the application parent directory. - /// A boolean value indicating if this application is a metro application. - /// The application command line string. - /// A new instance of representing the newly created application. - // ReSharper disable once TooManyArguments - // ReSharper disable once FunctionComplexityOverflow - public static ProfileApplication CreateApplication( - DriverSettingsProfile profile, - string applicationName, - string friendlyName = null, - string launcherName = null, - string[] fileInFolders = null, - bool isMetro = false, - string commandLine = null - ) - { - var createDelegates = new Func[] - { - CreateApplicationInstanceV4, - CreateApplicationInstanceV3, - CreateApplicationInstanceV2, - CreateApplicationInstanceV1 - }; - - Exception lastException = null; - IDRSApplication application = null; - - foreach (var func in createDelegates) - { - try - { - // ReSharper disable once EventExceptionNotDocumented - application = func( - applicationName, - friendlyName, - launcherName, - fileInFolders, - isMetro, - commandLine - ); - - break; - } - catch (NVIDIANotSupportedException e) - { - // ignore - lastException = e; - } - } - - if (application == null) - { - // ReSharper disable once ThrowingSystemException - throw lastException; - } - - application = DRSApi.CreateApplication(profile.Session.Handle, profile.Handle, application); - - return new ProfileApplication(application, profile); - } - - // ReSharper disable once TooManyArguments - private static IDRSApplication CreateApplicationInstanceV1( - string applicationName, - string friendlyName = null, - string launcherName = null, - string[] fileInFolders = null, - bool isMetro = false, - string commandLine = null - ) - { - if (!string.IsNullOrWhiteSpace(commandLine)) - { - throw new NotSupportedException( - "CommandLine is not supported with the current execution environment." - ); - } - - if (fileInFolders?.Length > 0) - { - throw new NotSupportedException( - "Same folder file presence check is not supported with the current execution environment." - ); - } - - return new DRSApplicationV1( - applicationName, - friendlyName, - launcherName - ); - } - - // ReSharper disable once TooManyArguments - private static IDRSApplication CreateApplicationInstanceV2( - string applicationName, - string friendlyName = null, - string launcherName = null, - string[] fileInFolders = null, - bool isMetro = false, - string commandLine = null - ) - { - if (!string.IsNullOrWhiteSpace(commandLine)) - { - throw new NotSupportedException( - "CommandLine is not supported with the current execution environment." - ); - } - - return new DRSApplicationV2( - applicationName, - friendlyName, - launcherName, - fileInFolders - ); - } - - // ReSharper disable once TooManyArguments - private static IDRSApplication CreateApplicationInstanceV3( - string applicationName, - string friendlyName = null, - string launcherName = null, - string[] fileInFolders = null, - bool isMetro = false, - string commandLine = null - ) - { - if (!string.IsNullOrWhiteSpace(commandLine)) - { - throw new NotSupportedException( - "CommandLine is not supported with the current execution environment." - ); - } - - return new DRSApplicationV3( - applicationName, - friendlyName, - launcherName, - fileInFolders, - isMetro - ); - } - - // ReSharper disable once TooManyArguments - private static IDRSApplication CreateApplicationInstanceV4( - string applicationName, - string friendlyName = null, - string launcherName = null, - string[] fileInFolders = null, - bool isMetro = false, - string commandLine = null - ) - { - return new DRSApplicationV4( - applicationName, - friendlyName, - launcherName, - fileInFolders, - isMetro, - commandLine - ); - } - - /// - public override string ToString() - { - if (!IsValid) - { - return "[Invalid]"; - } - - if (IsPredefined) - { - return $"{ApplicationName} (Predefined)"; - } - - return ApplicationName; - } - - /// - /// Deletes this application and makes this instance invalid - /// - public void Delete() - { - if (!IsValid) - { - throw new InvalidOperationException( - "Can not perform this operation with an invalid application instance." - ); - } - - DRSApi.DeleteApplication(Profile.Session.Handle, Profile.Handle, _application); - _application = null; - } - } -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/ProfileSetting.cs b/app/NvAPIWrapper/DRS/ProfileSetting.cs deleted file mode 100644 index bff491b4..00000000 --- a/app/NvAPIWrapper/DRS/ProfileSetting.cs +++ /dev/null @@ -1,126 +0,0 @@ -using System; -using NvAPIWrapper.Native.DRS; -using NvAPIWrapper.Native.DRS.Structures; - -namespace NvAPIWrapper.DRS -{ - /// - /// Represents a profile setting and its value - /// - public class ProfileSetting - { - private readonly DRSSettingV1 _setting; - - internal ProfileSetting(DRSSettingV1 setting) - { - _setting = setting; - } - - /// - /// Gets the current value of the setting - /// - public object CurrentValue - { - get - { - if (IsPredefinedValueValid && IsCurrentValuePredefined) - { - return _setting.PredefinedValue; - } - - return _setting.CurrentValue; - } - } - - /// - /// Gets a boolean value indicating if the current value is the predefined value. - /// - public bool IsCurrentValuePredefined - { - get => _setting.IsCurrentValuePredefined; - } - - /// - /// Gets a boolean value indicating if this setting had a predefined valid value. - /// - public bool IsPredefinedValueValid - { - get => _setting.IsPredefinedValueValid; - } - - /// - /// Gets the predefined value of this setting. - /// - public object PredefinedValue - { - get - { - if (!IsPredefinedValueValid) - { - throw new InvalidOperationException("Predefined value is not valid."); - } - - return _setting.PredefinedValue; - } - } - - /// - /// Gets the setting identification number - /// - public uint SettingId - { - get => _setting.Id; - } - - /// - /// Gets additional information regarding this setting including possible valid values - /// - public SettingInfo SettingInfo - { - get => SettingInfo.FromId(SettingId); - } - - /// - /// Gets the profile location of this setting - /// - public DRSSettingLocation SettingLocation - { - get => _setting.SettingLocation; - } - - /// - /// Gets the value type of this setting - /// - public DRSSettingType SettingType - { - get => _setting.SettingType; - } - - /// - public override string ToString() - { - string settingName = null; - - try - { - settingName = SettingInfo.Name; - } - catch - { - // ignore; - } - - if (string.IsNullOrWhiteSpace(settingName)) - { - settingName = $"#{SettingId:X}"; - } - - if (IsCurrentValuePredefined) - { - return $"{settingName} = {CurrentValue ?? "[NULL]"} (Predefined)"; - } - - return $"{settingName} = {CurrentValue ?? "[NULL]"}"; - } - } -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingInfo.cs b/app/NvAPIWrapper/DRS/SettingInfo.cs deleted file mode 100644 index 30283169..00000000 --- a/app/NvAPIWrapper/DRS/SettingInfo.cs +++ /dev/null @@ -1,360 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Reflection; -using NvAPIWrapper.Native; -using NvAPIWrapper.Native.DRS; - -namespace NvAPIWrapper.DRS -{ - /// - /// Contains information about a setting - /// - public class SettingInfo - { - private static uint[] _availableSettingIds; - - private SettingInfo(uint settingId) - { - SettingId = settingId; - } - - /// - /// Gets an array of available possible valid values. - /// - public object[] AvailableValues - { - get - { - if (!IsAvailable) - { - return null; - } - - return DRSApi.EnumAvailableSettingValues(SettingId).Values; - } - } - - /// - /// Gets the default value of this setting - /// - public object DefaultValue - { - get - { - if (!IsAvailable) - { - return null; - } - - var values = DRSApi.EnumAvailableSettingValues(SettingId); - - return values.DefaultValue; - } - } - - /// - /// Gets a boolean value indicating if this setting is available on this machine and with the current version of NVIDIA - /// driver - /// - public bool IsAvailable - { - get => GetAvailableSetting().Any(info => info.SettingId == SettingId); - } - - /// - /// Gets a boolean value indicating if this setting is know by this library - /// - public bool IsKnown - { - get => IsSettingKnown(SettingId); - } - - /// - /// Gets the description of this setting from the library or if this setting is not known by - /// the library. - /// - public string KnownDescription - { - get - { - if (!IsKnown || KnownSettingId == null) - { - return null; - } - - return GetSettingDescription(KnownSettingId.Value); - } - } - - /// - /// Gets the known identification number of this setting from the library or if this setting is - /// not known by the library. - /// - public KnownSettingId? KnownSettingId - { - get - { - if (!IsKnown) - { - return null; - } - - return GetKnownSettingId(SettingId); - } - } - - /// - /// Gets the type of a static class or an enum containing possible known values for this setting from the library or - /// if this setting is not known by the library - /// - public Type KnownValueType - { - get - { - if (!IsKnown || !IsAvailable) - { - return null; - } - - var name = KnownSettingId.ToString(); - var nameSpace = typeof(SettingInfo).Namespace + ".SettingValues"; - - if (SettingType == DRSSettingType.Integer) - { - return Assembly.GetExecutingAssembly().GetTypes().FirstOrDefault(type => - type.IsEnum && - type.Namespace?.Equals(nameSpace, StringComparison.InvariantCultureIgnoreCase) == true && - type.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)); - } - - if (SettingType == DRSSettingType.String || SettingType == DRSSettingType.UnicodeString) - { - return Assembly.GetExecutingAssembly().GetTypes().FirstOrDefault(type => - type.IsClass && - type.Namespace?.Equals(nameSpace, StringComparison.InvariantCultureIgnoreCase) == true && - type.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)); - } - - return null; - } - } - - /// - /// Gets the name of the setting from NVIDIA driver or if the setting is not available on this - /// machine. - /// - public string Name - { - get - { - if (!IsAvailable) - { - return null; - } - - return DRSApi.GetSettingNameFromId(SettingId); - } - } - - /// - /// Gets the setting identification number - /// - public uint SettingId { get; } - - /// - /// Gets the value type of the setting from NVIDIA driver or if the setting is not available on - /// this machine. - /// - public DRSSettingType? SettingType - { - get - { - if (!IsAvailable) - { - return null; - } - - var values = DRSApi.EnumAvailableSettingValues(SettingId); - - return values.SettingType; - } - } - - /// - /// Gets information regarding a setting from its identification number. - /// - /// The identification number of the setting to get information about. - /// An instance of containing information about the setting. - public static SettingInfo FromId(uint settingId) - { - return new SettingInfo(settingId); - } - - /// - /// Gets information regarding a setting from its known identification number. - /// - /// The known identification number of the setting to get information about. - /// An instance of containing information about the setting. - public static SettingInfo FromKnownSettingId(KnownSettingId settingId) - { - return FromId(GetSettingId(settingId)); - } - - /// - /// Gets information regarding a setting from its name. - /// - /// The name of the setting to get information about. - /// An instance of containing information about the setting. - public static SettingInfo FromName(string settingName) - { - var settingId = DRSApi.GetSettingIdFromName(settingName); - - return FromId(settingId); - } - - /// - /// Gets a list of all available setting on this machine - /// - /// Instances of each representing a available setting on this machine. - public static SettingInfo[] GetAvailableSetting() - { - if (_availableSettingIds == null) - { - _availableSettingIds = DRSApi.EnumAvailableSettingIds(); - } - - return _availableSettingIds.Select(FromId).ToArray(); - } - - /// - /// Gets the known identification number of a setting from its identification number - /// - /// The setting identification number. - /// The known setting identification number if the setting is known; otherwise . - public static KnownSettingId? GetKnownSettingId(uint settingId) - { - if (!IsSettingKnown(settingId)) - { - return null; - } - - return (KnownSettingId) settingId; - } - - /// - /// Gets the known setting description from its identification number - /// - /// The known setting identification number. - /// The known setting description if available; otherwise . - public static string GetSettingDescription(KnownSettingId knownSettingId) - { - var enumName = Enum.GetName(typeof(KnownSettingId), knownSettingId); - - if (enumName == null) - { - return null; - } - - var enumField = typeof(KnownSettingId).GetField(enumName); - - if (enumField == null) - { - return null; - } - - var descriptionAttribute = enumField - .GetCustomAttributes(typeof(DescriptionAttribute), false) - .OfType() - .FirstOrDefault(); - - if (string.IsNullOrWhiteSpace(descriptionAttribute?.Description)) - { - return null; - } - - return descriptionAttribute.Description; - } - - /// - /// Gets the identification number of a setting from its known identification number - /// - /// The known setting identification number. - /// The setting identification number. - public static uint GetSettingId(KnownSettingId knownSettingId) - { - return (uint) knownSettingId; - } - - /// - /// Checks if a setting is known by this library. - /// - /// The setting identification number. - /// true if setting is known by this library; otherwise false. - public static bool IsSettingKnown(uint settingId) - { - return Enum.IsDefined(typeof(KnownSettingId), settingId); - } - - /// - public override string ToString() - { - try - { - var settingName = Name; - - if (!string.IsNullOrWhiteSpace(settingName)) - { - return settingName; - } - } - catch - { - // ignore; - } - - return $"#{SettingId:X}"; - } - - /// - /// Tries to resolve the name of a known value using its actual value - /// - /// The actual value - /// The name of the known value member. - public string ResolveKnownValueName(object value) - { - if (!IsKnown) - { - return null; - } - - var valueType = KnownValueType; - - if (valueType == null) - { - return null; - } - - if (valueType.IsEnum) - { - return Enum.GetName(valueType, value); - } - - var comparerType = typeof(EqualityComparer<>).MakeGenericType(value.GetType()); - var comparer = comparerType.GetProperty(nameof(EqualityComparer.Default))?.GetValue(null); - - if (!(comparer is IEqualityComparer equalityComparer)) - { - return null; - } - - return valueType.GetFields() - .FirstOrDefault(info => - info.IsStatic && - equalityComparer.Equals(info.GetValue(null), value) - )?.Name; - } - } -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/AmbientOcclusionMode.cs b/app/NvAPIWrapper/DRS/SettingValues/AmbientOcclusionMode.cs deleted file mode 100644 index 89d0585b..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/AmbientOcclusionMode.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum AmbientOcclusionMode : uint - { - Off = 0x0, - - Low = 0x1, - - Medium = 0x2, - - High = 0x3, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/AmbientOcclusionModeActive.cs b/app/NvAPIWrapper/DRS/SettingValues/AmbientOcclusionModeActive.cs deleted file mode 100644 index 224c4272..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/AmbientOcclusionModeActive.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum AmbientOcclusionModeActive : uint - { - Disabled = 0x0, - - Enabled = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/AnisotropicModeLevel.cs b/app/NvAPIWrapper/DRS/SettingValues/AnisotropicModeLevel.cs deleted file mode 100644 index 94a2323c..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/AnisotropicModeLevel.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum AnisotropicModeLevel : uint - { - Mask = 0xFFFF, - - NonePoint = 0x0, - - NoneLinear = 0x1, - - Maximum = 0x10, - - Default = 0x1 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/AnisotropicModeSelector.cs b/app/NvAPIWrapper/DRS/SettingValues/AnisotropicModeSelector.cs deleted file mode 100644 index 1b17c299..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/AnisotropicModeSelector.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum AnisotropicModeSelector : uint - { - Mask = 0xF, - - Application = 0x0, - - User = 0x1, - - Condition = 0x2, - - Maximum = 0x2, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/AnselAllow.cs b/app/NvAPIWrapper/DRS/SettingValues/AnselAllow.cs deleted file mode 100644 index 5fab80eb..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/AnselAllow.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum AnselAllow : uint - { - Disallowed = 0x0, - - Allowed = 0x1, - - Default = 0x1 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/AnselEnable.cs b/app/NvAPIWrapper/DRS/SettingValues/AnselEnable.cs deleted file mode 100644 index fc8cd07c..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/AnselEnable.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum AnselEnable : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x1 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/AnselWhiteListed.cs b/app/NvAPIWrapper/DRS/SettingValues/AnselWhiteListed.cs deleted file mode 100644 index 6eb506af..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/AnselWhiteListed.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum AnselWhiteListed : uint - { - Disallowed = 0x0, - - Allowed = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingBehaviorFlags.cs b/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingBehaviorFlags.cs deleted file mode 100644 index 5ae81d8d..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingBehaviorFlags.cs +++ /dev/null @@ -1,43 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum AntiAliasingBehaviorFlags : uint - { - None = 0x0, - - TreatOverrideAsApplicationControlled = 0x1, - - TreatOverrideAsEnhance = 0x2, - - DisableOverride = 0x3, - - TreatEnhanceAsApplicationControlled = 0x4, - - TreatEnhanceAsOverride = 0x8, - - DisableEnhance = 0xC, - - MapVCAAToMultiSampling = 0x10000, - - SLIDisableTransparencySupersampling = 0x20000, - - DisableCplaa = 0x40000, - - SkipRTDIMCheckForEnhance = 0x80000, - - DisableSLIAntiAliasing = 0x100000, - - Default = 0x0, - - AntiAliasingRTBPPDIV4 = 0xF0000000, - - AntiAliasingRTBPPDIV4Shift = 0x1C, - - NonAntiAliasingRTBPPDIV4 = 0xF000000, - - NonAntiAliasingRTBPPDIV4Shift = 0x18, - - Mask = 0xFF1F000F - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingModeAlphaToCoverage.cs b/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingModeAlphaToCoverage.cs deleted file mode 100644 index 9973ffa6..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingModeAlphaToCoverage.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum AntiAliasingModeAlphaToCoverage : uint - { - ModeMask = 0x4, - - ModeOff = 0x0, - - ModeOn = 0x4, - - ModeMaximum = 0x4, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingModeGammaCorrection.cs b/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingModeGammaCorrection.cs deleted file mode 100644 index f63e9c4e..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingModeGammaCorrection.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum AntiAliasingModeGammaCorrection : uint - { - Mask = 0x3, - - Off = 0x0, - - OnIfFOS = 0x1, - - OnAlways = 0x2, - - Maximum = 0x2, - - Default = 0x0, - - DefaultTesla = 0x2, - - DefaultFermi = 0x2 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingModeMethod.cs b/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingModeMethod.cs deleted file mode 100644 index b88d1815..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingModeMethod.cs +++ /dev/null @@ -1,109 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum AntiAliasingModeMethod : uint - { - None = 0x0, - - SuperSample2XHorizontal = 0x1, - - SuperSample2XVertical = 0x2, - - SuperSample15X15 = 0x2, - - Free0X03 = 0x3, - - Free0X04 = 0x4, - - SuperSample4X = 0x5, - - SuperSample4XBias = 0x6, - - SuperSample4XGaussian = 0x7, - - Free0X08 = 0x8, - - Free0X09 = 0x9, - - SuperSample9X = 0xA, - - SuperSample9XBias = 0xB, - - SuperSample16X = 0xC, - - SuperSample16XBias = 0xD, - - MultiSample2XDiagonal = 0xE, - - MultiSample2XQuincunx = 0xF, - - MultiSample4X = 0x10, - - Free0X11 = 0x11, - - MultiSample4XGaussian = 0x12, - - MixedSample4XSkewed4Tap = 0x13, - - Free0X14 = 0x14, - - Free0X15 = 0x15, - - MixedSample6X = 0x16, - - MixedSample6XSkewed6Tap = 0x17, - - MixedSample8X = 0x18, - - MixedSample8XSkewed8Tap = 0x19, - - MixedSample16X = 0x1A, - - MultiSample4XGamma = 0x1B, - - MultiSample16X = 0x1C, - - VCAA32X8V24 = 0x1D, - - CorruptionCheck = 0x1E, - - _6XCT = 0x1F, - - MultiSample2XDiagonalGamma = 0x20, - - SuperSample4XGamma = 0x21, - - MultiSample4XFosgamma = 0x22, - - MultiSample2XDiagonalFosgamma = 0x23, - - SuperSample4XFosgamma = 0x24, - - MultiSample8X = 0x25, - - VCAA8X4V4 = 0x26, - - VCAA16X4V12 = 0x27, - - VCAA16X8V8 = 0x28, - - MixedSample32X = 0x29, - - SuperVCAA64X4V12 = 0x2A, - - SuperVCAA64X8V8 = 0x2B, - - MixedSample64X = 0x2C, - - MixedSample128X = 0x2D, - - Count = 0x2E, - - MethodMask = 0xFFFF, - - MethodMaximum = 0xF1C57815, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingModeReplay.cs b/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingModeReplay.cs deleted file mode 100644 index 69a23c9b..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingModeReplay.cs +++ /dev/null @@ -1,49 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum AntiAliasingModeReplay : uint - { - SamplesMask = 0x70, - - SamplesOne = 0x0, - - SamplesTwo = 0x10, - - SamplesFour = 0x20, - - SamplesEight = 0x30, - - SamplesMaximum = 0x30, - - ModeMask = 0xF, - - ModeOff = 0x0, - - ModeAlphaTest = 0x1, - - ModePixelKill = 0x2, - - ModeDynamicBranch = 0x4, - - ModeOptimal = 0x4, - - ModeAll = 0x8, - - ModeMaximum = 0xF, - - Transparency = 0x23, - - DisAllowTraa = 0x100, - - TransparencyDefault = 0x0, - - TransparencyDefaultTesla = 0x0, - - TransparencyDefaultFermi = 0x0, - - Mask = 0x17F, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingModeSelector.cs b/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingModeSelector.cs deleted file mode 100644 index 67d45312..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingModeSelector.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum AntiAliasingModeSelector : uint - { - Mask = 0x3, - - ApplicationControl = 0x0, - - Override = 0x1, - - Enhance = 0x2, - - Maximum = 0x2, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingModeSelectorSLIAntiAliasing.cs b/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingModeSelectorSLIAntiAliasing.cs deleted file mode 100644 index 3e94664c..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/AntiAliasingModeSelectorSLIAntiAliasing.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum AntiAliasingModeSelectorSLIAntiAliasing : uint - { - Disabled = 0x0, - - Enabled = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/ApplicationProfileNotificationTimeOut.cs b/app/NvAPIWrapper/DRS/SettingValues/ApplicationProfileNotificationTimeOut.cs deleted file mode 100644 index 9c4e1396..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/ApplicationProfileNotificationTimeOut.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum ApplicationProfileNotificationTimeOut : uint - { - Disabled = 0x0, - - NineSeconds = 0x9, - - FifteenSeconds = 0xF, - - ThirtySeconds = 0x1E, - - OneMinute = 0x3C, - - TwoMinutes = 0x78, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/AutoLODBiasAdjust.cs b/app/NvAPIWrapper/DRS/SettingValues/AutoLODBiasAdjust.cs deleted file mode 100644 index da748213..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/AutoLODBiasAdjust.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum AutoLODBiasAdjust : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x1 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/BatteryBoost.cs b/app/NvAPIWrapper/DRS/SettingValues/BatteryBoost.cs deleted file mode 100644 index 88dfb27c..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/BatteryBoost.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum BatteryBoost : uint - { - Minimum = 0x1, - - Maximum = 0xFF, - - Enabled = 0x10000000, - - Disabled = 0x0, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/CUDAExcludedGPUs.cs b/app/NvAPIWrapper/DRS/SettingValues/CUDAExcludedGPUs.cs deleted file mode 100644 index 95f2fffb..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/CUDAExcludedGPUs.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public static class CUDAExcludedGPUs - { - public const string Default = "none"; - public const string None = "none"; - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/ControlPanelHiddenProfile.cs b/app/NvAPIWrapper/DRS/SettingValues/ControlPanelHiddenProfile.cs deleted file mode 100644 index 703254a7..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/ControlPanelHiddenProfile.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum ControlPanelHiddenProfile : uint - { - Disabled = 0x0, - - Enabled = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/D3DOpenGLGPUMaximumPower.cs b/app/NvAPIWrapper/DRS/SettingValues/D3DOpenGLGPUMaximumPower.cs deleted file mode 100644 index 4f89c547..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/D3DOpenGLGPUMaximumPower.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public static class D3DOpenGLGPUMaximumPower - { - public const string Default = "0"; - public const string DefaultPower = "0"; - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/ExportPerformanceCounters.cs b/app/NvAPIWrapper/DRS/SettingValues/ExportPerformanceCounters.cs deleted file mode 100644 index 15a02700..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/ExportPerformanceCounters.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum ExportPerformanceCounters : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/ExportPerformanceCountersDX9Only.cs b/app/NvAPIWrapper/DRS/SettingValues/ExportPerformanceCountersDX9Only.cs deleted file mode 100644 index ecc32157..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/ExportPerformanceCountersDX9Only.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum ExportPerformanceCountersDX9Only : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/FXAAAllow.cs b/app/NvAPIWrapper/DRS/SettingValues/FXAAAllow.cs deleted file mode 100644 index 30100d64..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/FXAAAllow.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum FXAAAllow : uint - { - Disallowed = 0x0, - - Allowed = 0x1, - - Default = 0x1 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/FXAAEnable.cs b/app/NvAPIWrapper/DRS/SettingValues/FXAAEnable.cs deleted file mode 100644 index 14318717..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/FXAAEnable.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum FXAAEnable : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/FXAAIndicatorEnable.cs b/app/NvAPIWrapper/DRS/SettingValues/FXAAIndicatorEnable.cs deleted file mode 100644 index be683634..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/FXAAIndicatorEnable.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum FXAAIndicatorEnable : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/LODBiasAdjust.cs b/app/NvAPIWrapper/DRS/SettingValues/LODBiasAdjust.cs deleted file mode 100644 index 2c4fb707..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/LODBiasAdjust.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum LODBiasAdjust : uint - { - Minimum = 0xFFFFFF80, - - Maximum = 0x80, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/MCSFRShowSplit.cs b/app/NvAPIWrapper/DRS/SettingValues/MCSFRShowSplit.cs deleted file mode 100644 index c9c7d9f3..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/MCSFRShowSplit.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum MCSFRShowSplit : uint - { - Disabled = 0x34534064, - - Enabled = 0x24545582, - - Default = 0x34534064 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/MaxwellBSampleInterleave.cs b/app/NvAPIWrapper/DRS/SettingValues/MaxwellBSampleInterleave.cs deleted file mode 100644 index a27b8b93..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/MaxwellBSampleInterleave.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum MaxwellBSampleInterleave : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/NvidiaQualityUpScaling.cs b/app/NvAPIWrapper/DRS/SettingValues/NvidiaQualityUpScaling.cs deleted file mode 100644 index 047a4dbe..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/NvidiaQualityUpScaling.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum NvidiaQualityUpScaling : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/OpenGLAntiAliasingLineGamma.cs b/app/NvAPIWrapper/DRS/SettingValues/OpenGLAntiAliasingLineGamma.cs deleted file mode 100644 index 50aac82f..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/OpenGLAntiAliasingLineGamma.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum OpenGLAntiAliasingLineGamma : uint - { - Disabled = 0x10, - - Enabled = 0x23, - - Minimum = 0x1, - - Maximum = 0x64, - - Default = 0x10 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/OpenGLDeepColorScanOut.cs b/app/NvAPIWrapper/DRS/SettingValues/OpenGLDeepColorScanOut.cs deleted file mode 100644 index 328390ff..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/OpenGLDeepColorScanOut.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum OpenGLDeepColorScanOut : uint - { - Disable = 0x0, - - Enable = 0x1, - - Default = 0x1 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/OpenGLDefaultSwapInterval.cs b/app/NvAPIWrapper/DRS/SettingValues/OpenGLDefaultSwapInterval.cs deleted file mode 100644 index b9e250a6..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/OpenGLDefaultSwapInterval.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum OpenGLDefaultSwapInterval : uint - { - Tear = 0x0, - - VSyncOne = 0x1, - - VSync = 0x1, - - ValueMask = 0xFFFF, - - ForceMask = 0xF0000000, - - ForceOff = 0xF0000000, - - ForceOn = 0x10000000, - - ApplicationControlled = 0x0, - - Disable = 0xFFFFFFFF, - - Default = 0x1 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/OpenGLDefaultSwapIntervalFractional.cs b/app/NvAPIWrapper/DRS/SettingValues/OpenGLDefaultSwapIntervalFractional.cs deleted file mode 100644 index 4c247d47..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/OpenGLDefaultSwapIntervalFractional.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum OpenGLDefaultSwapIntervalFractional : uint - { - ZeroScanLines = 0x0, - - OneFullFrameOfScanLines = 0x64, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/OpenGLDefaultSwapIntervalSign.cs b/app/NvAPIWrapper/DRS/SettingValues/OpenGLDefaultSwapIntervalSign.cs deleted file mode 100644 index 1a25cd1a..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/OpenGLDefaultSwapIntervalSign.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum OpenGLDefaultSwapIntervalSign : uint - { - Positive = 0x0, - - Negative = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/OpenGLEventLogSeverityThreshold.cs b/app/NvAPIWrapper/DRS/SettingValues/OpenGLEventLogSeverityThreshold.cs deleted file mode 100644 index 5b1e50fc..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/OpenGLEventLogSeverityThreshold.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum OpenGLEventLogSeverityThreshold : uint - { - Disable = 0x0, - - Critical = 0x1, - - Warning = 0x2, - - Information = 0x3, - - All = 0x4, - - Default = 0x4 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/OpenGLForceBlit.cs b/app/NvAPIWrapper/DRS/SettingValues/OpenGLForceBlit.cs deleted file mode 100644 index 1ef9b76a..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/OpenGLForceBlit.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum OpenGLForceBlit : uint - { - On = 0x1, - - Off = 0x0, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/OpenGLForceStereo.cs b/app/NvAPIWrapper/DRS/SettingValues/OpenGLForceStereo.cs deleted file mode 100644 index e7888d76..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/OpenGLForceStereo.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum OpenGLForceStereo : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/OpenGLImplicitGPUAffinity.cs b/app/NvAPIWrapper/DRS/SettingValues/OpenGLImplicitGPUAffinity.cs deleted file mode 100644 index 312977c5..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/OpenGLImplicitGPUAffinity.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public static class OpenGLImplicitGPUAffinity - { - public const string AutoSelect = "autoselect"; - - public const string Default = "autoselect"; - public const string EnvironmentVariable = "OGL_DEFAULT_RENDERING_GPU"; - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/OpenGLOverlayPixelType.cs b/app/NvAPIWrapper/DRS/SettingValues/OpenGLOverlayPixelType.cs deleted file mode 100644 index e3ae79c8..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/OpenGLOverlayPixelType.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum OpenGLOverlayPixelType : uint - { - None = 0x0, - - CI = 0x1, - - RGBA = 0x2, - - CIAndRGBA = 0x3, - - Default = 0x1 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/OpenGLOverlaySupport.cs b/app/NvAPIWrapper/DRS/SettingValues/OpenGLOverlaySupport.cs deleted file mode 100644 index 36c0306d..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/OpenGLOverlaySupport.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum OpenGLOverlaySupport : uint - { - Off = 0x0, - - On = 0x1, - - ForceSoftware = 0x2, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/OpenGLQualityEnhancements.cs b/app/NvAPIWrapper/DRS/SettingValues/OpenGLQualityEnhancements.cs deleted file mode 100644 index a24cec6c..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/OpenGLQualityEnhancements.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum OpenGLQualityEnhancements : uint - { - HighQuality = 0xFFFFFFF6, - - Quality = 0x0, - - Performance = 0xA, - - HighPerformance = 0x14, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/OpenGLSLIMulticast.cs b/app/NvAPIWrapper/DRS/SettingValues/OpenGLSLIMulticast.cs deleted file mode 100644 index 3b69bc1e..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/OpenGLSLIMulticast.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum OpenGLSLIMulticast : uint - { - Disable = 0x0, - - Enable = 0x1, - - ForceDisable = 0x2, - - AllowMosaic = 0x4, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/OpenGLSingleBackDepthBuffer.cs b/app/NvAPIWrapper/DRS/SettingValues/OpenGLSingleBackDepthBuffer.cs deleted file mode 100644 index aa245b83..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/OpenGLSingleBackDepthBuffer.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum OpenGLSingleBackDepthBuffer : uint - { - Disable = 0x0, - - Enable = 0x1, - - UseHardwareDefault = 0xFFFFFFFF, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/OpenGLTMONLevel.cs b/app/NvAPIWrapper/DRS/SettingValues/OpenGLTMONLevel.cs deleted file mode 100644 index 9a4ba4b2..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/OpenGLTMONLevel.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum OpenGLTMONLevel : uint - { - Disable = 0x0, - - Critical = 0x1, - - Warning = 0x2, - - Information = 0x3, - - Most = 0x4, - - Verbose = 0x5, - - Default = 0x4 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/OpenGLThreadControl.cs b/app/NvAPIWrapper/DRS/SettingValues/OpenGLThreadControl.cs deleted file mode 100644 index fe5b7c63..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/OpenGLThreadControl.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum OpenGLThreadControl : uint - { - Enable = 0x1, - - Disable = 0x2, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/OpenGLTripleBuffer.cs b/app/NvAPIWrapper/DRS/SettingValues/OpenGLTripleBuffer.cs deleted file mode 100644 index 968c4e65..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/OpenGLTripleBuffer.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum OpenGLTripleBuffer : uint - { - Disabled = 0x0, - - Enabled = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/OptimusMaximumAntiAliasing.cs b/app/NvAPIWrapper/DRS/SettingValues/OptimusMaximumAntiAliasing.cs deleted file mode 100644 index 6e309b11..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/OptimusMaximumAntiAliasing.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum OptimusMaximumAntiAliasing : uint - { - Minimum = 0x0, - - Maximum = 0x10, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateFrameRateLimiter.cs b/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateFrameRateLimiter.cs deleted file mode 100644 index cecda122..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateFrameRateLimiter.cs +++ /dev/null @@ -1,47 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum PerformanceStateFrameRateLimiter : uint - { - Disabled = 0x0, - - FPS20 = 0x14, - - FPS30 = 0x1E, - - FPS40 = 0x28, - - Fpsmask = 0xFF, - - NoAlign = 0x4000, - - BBQM = 0x8000, - - LowerFPSToAlign = 0x20000, - - ForceVSyncOff = 0x40000, - - GpsWeb = 0x80000, - - Disallowed = 0x200000, - - UseCPUWait = 0x400000, - - NoLagOffset = 0x800000, - - Accurate = 0x10000000, - - AllowWindowed = 0x20000000, - - ForceOn = 0x40000000, - - Enabled = 0x80000000, - - OpenGLRemoteDesktop = 0xE000003C, - - Mask = 0xF0EEC0FF, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateFrameRateLimiter2Control.cs b/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateFrameRateLimiter2Control.cs deleted file mode 100644 index 8ed25ba9..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateFrameRateLimiter2Control.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum PerformanceStateFrameRateLimiter2Control : uint - { - DelayCE = 0x0, - - Delay3D = 0x1, - - AvoidNoop = 0x2, - - DelayCEPresent3D = 0x8, - - AllowAllMaxwell = 0x10, - - AllowAll = 0x20, - - ForceOff = 0x40, - - EnableVCE = 0x80, - - DefaultForGM10X = 0x11, - - Default = 0x88 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateFrameRateLimiterGpsControl.cs b/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateFrameRateLimiterGpsControl.cs deleted file mode 100644 index f47b1640..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateFrameRateLimiterGpsControl.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum PerformanceStateFrameRateLimiterGpsControl : uint - { - Disabled = 0x0, - - DecreaseFilterMask = 0x1FF, - - PauseTimeMask = 0xFE00, - - PauseTimeShift = 0x9, - - TargetRenderTimeMask = 0xFF0000, - - TargetRenderTimeShift = 0x10, - - PerformanceStepSizeMask = 0x1F000000, - - PerformanceStepSizeShift = 0x18, - - IncreaseFilterMask = 0xE0000000, - - IncreaseFilterShift = 0x1D, - - OptimalSetting = 0x4A5A3219, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateFrameRateMonitorControl.cs b/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateFrameRateMonitorControl.cs deleted file mode 100644 index b916f4d5..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateFrameRateMonitorControl.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum PerformanceStateFrameRateMonitorControl : uint - { - Disabled = 0x0, - - ThresholdPctMask = 0xFF, - - MovingAverageXMask = 0xF00, - - MovingAverageXShift = 0x8, - - EnableFineGrained = 0x400000, - - EnableOnVSync = 0x800000, - - VSyncOffsetMask = 0xF000, - - VSyncOffsetShift = 0xC, - - FPSUseFrl = 0x0, - - FPS30 = 0x1E000000, - - FPS60 = 0x3C000000, - - FPSMask = 0xFF000000, - - FPSShift = 0x18, - - OptimalSetting = 0x364, - - VSyncOptimalSetting = 0x80F364, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateShaderDiskCache.cs b/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateShaderDiskCache.cs deleted file mode 100644 index c9ce57b2..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateShaderDiskCache.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum PerformanceStateShaderDiskCache : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x1 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateTextureFilteringAnisotropicOptimization.cs b/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateTextureFilteringAnisotropicOptimization.cs deleted file mode 100644 index e3810338..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateTextureFilteringAnisotropicOptimization.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum PerformanceStateTextureFilteringAnisotropicOptimization : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateTextureFilteringBiLinearInAnisotropic.cs b/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateTextureFilteringBiLinearInAnisotropic.cs deleted file mode 100644 index f40c0c59..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateTextureFilteringBiLinearInAnisotropic.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum PerformanceStateTextureFilteringBiLinearInAnisotropic : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateTextureFilteringDisableTrilinearSlope.cs b/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateTextureFilteringDisableTrilinearSlope.cs deleted file mode 100644 index 7d73f082..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateTextureFilteringDisableTrilinearSlope.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum PerformanceStateTextureFilteringDisableTrilinearSlope : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateTextureFilteringNoNegativeLODBias.cs b/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateTextureFilteringNoNegativeLODBias.cs deleted file mode 100644 index 7ba87768..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/PerformanceStateTextureFilteringNoNegativeLODBias.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum PerformanceStateTextureFilteringNoNegativeLODBias : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/PhysxIndicator.cs b/app/NvAPIWrapper/DRS/SettingValues/PhysxIndicator.cs deleted file mode 100644 index 30efd41a..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/PhysxIndicator.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum PhysxIndicator : uint - { - Disabled = 0x34534064, - - Enabled = 0x24545582, - - Default = 0x34534064 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/PreRenderLimit.cs b/app/NvAPIWrapper/DRS/SettingValues/PreRenderLimit.cs deleted file mode 100644 index ca1b713b..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/PreRenderLimit.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum PreRenderLimit : uint - { - Minimum = 0x0, - - Maximum = 0xFF, - - ApplicationControlled = 0x0, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/PreferredPerformanceState.cs b/app/NvAPIWrapper/DRS/SettingValues/PreferredPerformanceState.cs deleted file mode 100644 index a488c7b9..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/PreferredPerformanceState.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum PreferredPerformanceState : uint - { - Adaptive = 0x0, - - PreferMaximum = 0x1, - - DriverControlled = 0x2, - - PreferConsistentPerformance = 0x3, - - PreferMinimum = 0x4, - - OptimalPower = 0x5, - - Minimum = 0x0, - - Maximum = 0x5, - - Default = 0x5 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/PreventUiAnisotropicOverride.cs b/app/NvAPIWrapper/DRS/SettingValues/PreventUiAnisotropicOverride.cs deleted file mode 100644 index 7296fde5..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/PreventUiAnisotropicOverride.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum PreventUiAnisotropicOverride : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/QualityEnhancements.cs b/app/NvAPIWrapper/DRS/SettingValues/QualityEnhancements.cs deleted file mode 100644 index a2c82a18..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/QualityEnhancements.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum QualityEnhancements : uint - { - HighQuality = 0xFFFFFFF6, - - Quality = 0x0, - - Performance = 0xA, - - HighPerformance = 0x14, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/RefreshRateOverride.cs b/app/NvAPIWrapper/DRS/SettingValues/RefreshRateOverride.cs deleted file mode 100644 index f8e1430f..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/RefreshRateOverride.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum RefreshRateOverride : uint - { - ApplicationControlled = 0x0, - - HighestAvailable = 0x1, - - LowLatencyRefreshRateMask = 0xFF0, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/SLIGPUCount.cs b/app/NvAPIWrapper/DRS/SettingValues/SLIGPUCount.cs deleted file mode 100644 index 7f1e5081..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/SLIGPUCount.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum SLIGPUCount : uint - { - AutoSelect = 0x0, - - One = 0x1, - - Two = 0x2, - - Three = 0x3, - - Four = 0x4, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/SLIPredefinedGPUCount.cs b/app/NvAPIWrapper/DRS/SettingValues/SLIPredefinedGPUCount.cs deleted file mode 100644 index fc97f7bf..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/SLIPredefinedGPUCount.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum SLIPredefinedGPUCount : uint - { - AutoSelect = 0x0, - - One = 0x1, - - Two = 0x2, - - Three = 0x3, - - Four = 0x4, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/SLIPredefinedGPUCountDX10.cs b/app/NvAPIWrapper/DRS/SettingValues/SLIPredefinedGPUCountDX10.cs deleted file mode 100644 index 64deeef0..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/SLIPredefinedGPUCountDX10.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum SLIPredefinedGPUCountDX10 : uint - { - AutoSelect = 0x0, - - One = 0x1, - - Two = 0x2, - - Three = 0x3, - - Four = 0x4, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/SLIPredefinedMode.cs b/app/NvAPIWrapper/DRS/SettingValues/SLIPredefinedMode.cs deleted file mode 100644 index 8fac0ef1..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/SLIPredefinedMode.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum SLIPredefinedMode : uint - { - AutoSelect = 0x0, - - ForceSingle = 0x1, - - ForceAFR = 0x2, - - ForceAFR2 = 0x3, - - ForceSFR = 0x4, - - ForceAFROfSFRFallback3AFR = 0x5, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/SLIPredefinedModeDX10.cs b/app/NvAPIWrapper/DRS/SettingValues/SLIPredefinedModeDX10.cs deleted file mode 100644 index ceb65d92..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/SLIPredefinedModeDX10.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum SLIPredefinedModeDX10 : uint - { - AutoSelect = 0x0, - - ForceSingle = 0x1, - - ForceAFR = 0x2, - - ForceAFR2 = 0x3, - - ForceSFR = 0x4, - - ForceAFROfSFRFallback3AFR = 0x5, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/SLIRenderingMode.cs b/app/NvAPIWrapper/DRS/SettingValues/SLIRenderingMode.cs deleted file mode 100644 index 28808018..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/SLIRenderingMode.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum SLIRenderingMode : uint - { - AutoSelect = 0x0, - - ForceSingle = 0x1, - - ForceAFR = 0x2, - - ForceAFR2 = 0x3, - - ForceSFR = 0x4, - - ForceAFROfSFRFallback3AFR = 0x5, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/SetPowerThrottleForPCIeCompliance.cs b/app/NvAPIWrapper/DRS/SettingValues/SetPowerThrottleForPCIeCompliance.cs deleted file mode 100644 index 297d82cb..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/SetPowerThrottleForPCIeCompliance.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum SetPowerThrottleForPCIeCompliance : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/SetVABData.cs b/app/NvAPIWrapper/DRS/SettingValues/SetVABData.cs deleted file mode 100644 index 24e6ee84..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/SetVABData.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum SetVABData : uint - { - Zero = 0x0, - - UIntOne = 0x1, - - FloatOne = 0x3F800000, - - FloatPosInf = 0x7F800000, - - FloatNan = 0x7FC00000, - - UseAPIDefaults = 0xFFFFFFFF, - - Default = 0xFFFFFFFF - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/ShimMCCOMPAT.cs b/app/NvAPIWrapper/DRS/SettingValues/ShimMCCOMPAT.cs deleted file mode 100644 index a00c81ca..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/ShimMCCOMPAT.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum ShimMCCOMPAT : uint - { - Integrated = 0x0, - - Enable = 0x1, - - UserEditable = 0x2, - - Mask = 0x3, - - VideoMask = 0x4, - - VaryingBit = 0x8, - - AutoSelect = 0x10, - - OverrideBit = 0x80000000, - - Default = 0x10 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/ShimRenderingMode.cs b/app/NvAPIWrapper/DRS/SettingValues/ShimRenderingMode.cs deleted file mode 100644 index 8d6129ae..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/ShimRenderingMode.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum ShimRenderingMode : uint - { - Integrated = 0x0, - - Enable = 0x1, - - UserEditable = 0x2, - - Mask = 0x3, - - VideoMask = 0x4, - - VaryingBit = 0x8, - - AutoSelect = 0x10, - - OverrideBit = 0x80000000, - - Default = 0x10 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/ShimRenderingOptions.cs b/app/NvAPIWrapper/DRS/SettingValues/ShimRenderingOptions.cs deleted file mode 100644 index 63ec8ed0..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/ShimRenderingOptions.cs +++ /dev/null @@ -1,59 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum ShimRenderingOptions : uint - { - DefaultRenderingMode = 0x0, - - DisableAsyncPresent = 0x1, - - EHShellDetect = 0x2, - - FlashplayerHostDetect = 0x4, - - VideoDRMApplicationDetect = 0x8, - - IgnoreOverrides = 0x10, - - Reserved1 = 0x20, - - EnableDWMAsyncPresent = 0x40, - - Reserved2 = 0x80, - - AllowInheritance = 0x100, - - DisableWrappers = 0x200, - - DisableDxgiWrappers = 0x400, - - PruneUnsupportedFormats = 0x800, - - EnableAlphaFormat = 0x1000, - - IGPUTranscoding = 0x2000, - - DisableCUDA = 0x4000, - - AllowCpCapabilitiesForVideo = 0x8000, - - IGPUTranscodingFwdOptimus = 0x10000, - - DisableDuringSecureBoot = 0x20000, - - InvertForQuadro = 0x40000, - - InvertForMSHybrid = 0x80000, - - RegisterProcessEnableGold = 0x100000, - - HandleWindowedModePerformanceOptimal = 0x200000, - - HandleWin7AsyncRuntimeBug = 0x400000, - - ExplicitAdapterOptedByApplication = 0x800000, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/VRPreRenderLimit.cs b/app/NvAPIWrapper/DRS/SettingValues/VRPreRenderLimit.cs deleted file mode 100644 index 37e02d3c..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/VRPreRenderLimit.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum VRPreRenderLimit : uint - { - Minimum = 0x0, - - Maximum = 0xFF, - - ApplicationControlled = 0x0, - - Default = 0x1 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/VRRApplicationOverride.cs b/app/NvAPIWrapper/DRS/SettingValues/VRRApplicationOverride.cs deleted file mode 100644 index 87d546d7..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/VRRApplicationOverride.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum VRRApplicationOverride : uint - { - Allow = 0x0, - - ForceOff = 0x1, - - DisAllow = 0x2, - - ULMB = 0x3, - - FixedRefresh = 0x4, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/VRRApplicationOverrideRequestState.cs b/app/NvAPIWrapper/DRS/SettingValues/VRRApplicationOverrideRequestState.cs deleted file mode 100644 index 68d2d4c6..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/VRRApplicationOverrideRequestState.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum VRRApplicationOverrideRequestState : uint - { - Allow = 0x0, - - ForceOff = 0x1, - - DisAllow = 0x2, - - ULMB = 0x3, - - FixedRefresh = 0x4, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/VRRFeatureIndicator.cs b/app/NvAPIWrapper/DRS/SettingValues/VRRFeatureIndicator.cs deleted file mode 100644 index 4c422c0e..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/VRRFeatureIndicator.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum VRRFeatureIndicator : uint - { - Disabled = 0x0, - - Enabled = 0x1, - - Default = 0x1 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/VRRMode.cs b/app/NvAPIWrapper/DRS/SettingValues/VRRMode.cs deleted file mode 100644 index 267d1057..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/VRRMode.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum VRRMode : uint - { - Disabled = 0x0, - - FullScreenOnly = 0x1, - - FullScreenAndWindowed = 0x2, - - Default = 0x1 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/VRROverlayIndicator.cs b/app/NvAPIWrapper/DRS/SettingValues/VRROverlayIndicator.cs deleted file mode 100644 index 18dd7c59..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/VRROverlayIndicator.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum VRROverlayIndicator : uint - { - Disabled = 0x0, - - Enabled = 0x1, - - Default = 0x1 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/VRRRequestState.cs b/app/NvAPIWrapper/DRS/SettingValues/VRRRequestState.cs deleted file mode 100644 index 97b75c82..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/VRRRequestState.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum VRRRequestState : uint - { - Disabled = 0x0, - - FullScreenOnly = 0x1, - - FullScreenAndWindowed = 0x2, - - Default = 0x1 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/VSyncBehaviorFlags.cs b/app/NvAPIWrapper/DRS/SettingValues/VSyncBehaviorFlags.cs deleted file mode 100644 index f9ba2316..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/VSyncBehaviorFlags.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum VSyncBehaviorFlags : uint - { - None = 0x0, - - Default = 0x0, - - IgnoreFlipIntervalMultiple = 0x1 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/VSyncMode.cs b/app/NvAPIWrapper/DRS/SettingValues/VSyncMode.cs deleted file mode 100644 index 4701c8cc..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/VSyncMode.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum VSyncMode : uint - { - Passive = 0x60925292, - - ForceOff = 0x8416747, - - ForceOn = 0x47814940, - - FlipInterval2 = 0x32610244, - - FlipInterval3 = 0x71271021, - - FlipInterval4 = 0x13245256, - - Virtual = 0x18888888, - - Default = 0x60925292 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/VSyncSmoothAFR.cs b/app/NvAPIWrapper/DRS/SettingValues/VSyncSmoothAFR.cs deleted file mode 100644 index 3eb379ca..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/VSyncSmoothAFR.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum VSyncSmoothAFR : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/VSyncTearControl.cs b/app/NvAPIWrapper/DRS/SettingValues/VSyncTearControl.cs deleted file mode 100644 index da9c2b97..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/VSyncTearControl.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum VSyncTearControl : uint - { - Disable = 0x96861077, - - Enable = 0x99941284, - - Default = 0x96861077 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/VSyncVRRControl.cs b/app/NvAPIWrapper/DRS/SettingValues/VSyncVRRControl.cs deleted file mode 100644 index 01b06b51..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/VSyncVRRControl.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum VSyncVRRControl : uint - { - Disable = 0x0, - - Enable = 0x1, - - NotSupported = 0x9F95128E, - - Default = 0x1 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/WKSAPIStereoEyesExchange.cs b/app/NvAPIWrapper/DRS/SettingValues/WKSAPIStereoEyesExchange.cs deleted file mode 100644 index e313bdd5..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/WKSAPIStereoEyesExchange.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum WKSAPIStereoEyesExchange : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/WKSAPIStereoMode.cs b/app/NvAPIWrapper/DRS/SettingValues/WKSAPIStereoMode.cs deleted file mode 100644 index 6e5371f1..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/WKSAPIStereoMode.cs +++ /dev/null @@ -1,59 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum WKSAPIStereoMode : uint - { - ShutterGlasses = 0x0, - - VerticalInterlaced = 0x1, - - Twinview = 0x2, - - NV17ShutterGlassesAuto = 0x3, - - NV17ShutterGlassesDAC0 = 0x4, - - NV17ShutterGlassesDAC1 = 0x5, - - ColorLine = 0x6, - - ColorInterleaved = 0x7, - - Anaglyph = 0x8, - - HorizontalInterlaced = 0x9, - - SideField = 0xA, - - SubField = 0xB, - - CheckerBoard = 0xC, - - InverseCheckerBoard = 0xD, - - TridelitySL = 0xE, - - TridelityMV = 0xF, - - SeeFront = 0x10, - - StereoMirror = 0x11, - - FrameSequential = 0x12, - - AutodetectPassiveMode = 0x13, - - AegisDTFrameSequential = 0x14, - - OEMEmitterFrameSequential = 0x15, - - DPInBand = 0x16, - - UseHardwareDefault = 0xFFFFFFFF, - - DefaultGL = 0x3, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/WKSMemoryAllocationPolicy.cs b/app/NvAPIWrapper/DRS/SettingValues/WKSMemoryAllocationPolicy.cs deleted file mode 100644 index 51b6f4d9..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/WKSMemoryAllocationPolicy.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum WKSMemoryAllocationPolicy : uint - { - AsNeeded = 0x0, - - ModeratePreAllocation = 0x1, - - AggressivePreAllocation = 0x2, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/WKSStereoDongleSupport.cs b/app/NvAPIWrapper/DRS/SettingValues/WKSStereoDongleSupport.cs deleted file mode 100644 index 2a5fa499..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/WKSStereoDongleSupport.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum WKSStereoDongleSupport : uint - { - Off = 0x0, - - DAC = 0x1, - - DLP = 0x2, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/WKSStereoSupport.cs b/app/NvAPIWrapper/DRS/SettingValues/WKSStereoSupport.cs deleted file mode 100644 index b31b492a..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/WKSStereoSupport.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum WKSStereoSupport : uint - { - Off = 0x0, - - On = 0x1, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/DRS/SettingValues/WKSStereoSwapMode.cs b/app/NvAPIWrapper/DRS/SettingValues/WKSStereoSwapMode.cs deleted file mode 100644 index 51fc8196..00000000 --- a/app/NvAPIWrapper/DRS/SettingValues/WKSStereoSwapMode.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace NvAPIWrapper.DRS.SettingValues -{ -#pragma warning disable 1591 - public enum WKSStereoSwapMode : uint - { - ApplicationControl = 0x0, - - PerEye = 0x1, - - PerEyePair = 0x2, - - LegacyBehavior = 0x3, - - Default = 0x0 - } -#pragma warning restore 1591 -} \ No newline at end of file diff --git a/app/NvAPIWrapper/Mosaic/GridTopology.cs b/app/NvAPIWrapper/Mosaic/GridTopology.cs deleted file mode 100644 index 8b9134f3..00000000 --- a/app/NvAPIWrapper/Mosaic/GridTopology.cs +++ /dev/null @@ -1,373 +0,0 @@ -using System; -using System.Linq; -using NvAPIWrapper.Native; -using NvAPIWrapper.Native.Display.Structures; -using NvAPIWrapper.Native.Exceptions; -using NvAPIWrapper.Native.General; -using NvAPIWrapper.Native.Interfaces.Mosaic; -using NvAPIWrapper.Native.Mosaic; -using NvAPIWrapper.Native.Mosaic.Structures; - -namespace NvAPIWrapper.Mosaic -{ - /// - /// Represents a mosaic grid topology - /// - public class GridTopology : IEquatable - { - /// - /// Creates a new GridTopology - /// - /// Mosaic rows - /// Mosaic columns - /// Topology displays - public GridTopology(int rows, int columns, GridTopologyDisplay[] displays) - { - SetDisplays(rows, columns, displays); - var possibleDisplaySettings = GetPossibleDisplaySettings(); - - if (possibleDisplaySettings.Any()) - { - SetDisplaySettings( - possibleDisplaySettings.OrderByDescending( - settings => (long) settings.Width * - settings.Height * - settings.BitsPerPixel * - settings.Frequency) - .First()); - } - } - - /// - /// Creates a new GridTopology - /// - /// A IGridTopology implamented object - public GridTopology(IGridTopology gridTopology) - { - Rows = gridTopology.Rows; - Columns = gridTopology.Columns; - Displays = gridTopology.Displays.Select(display => new GridTopologyDisplay(display)).ToArray(); - SetDisplaySettings(gridTopology.DisplaySettings); - ApplyWithBezelCorrectedResolution = gridTopology.ApplyWithBezelCorrectedResolution; - ImmersiveGaming = gridTopology.ImmersiveGaming; - BaseMosaicPanoramic = gridTopology.BaseMosaicPanoramic; - DriverReloadAllowed = gridTopology.DriverReloadAllowed; - AcceleratePrimaryDisplay = gridTopology.AcceleratePrimaryDisplay; - } - - /// - /// Gets or sets a boolean value enabling SLI acceleration on the primary display while in single-wide mode (For - /// Immersive Gaming only). - /// - public bool AcceleratePrimaryDisplay { get; set; } - - /// - /// Gets or sets a boolean value forcing to the bezel-corrected resolution when enabling and doing the modeset - /// - public bool ApplyWithBezelCorrectedResolution { get; set; } - - /// - /// Gets or sets a boolean value enabling the Base Mosaic (Panoramic) instead of Mosaic SLI (for NVS and Quadro-boards - /// only) - /// - public bool BaseMosaicPanoramic { get; set; } - - /// - /// Gets the mosaic columns - /// - public int Columns { get; private set; } - - /// - /// Gets topology displays - /// - public GridTopologyDisplay[] Displays { get; private set; } - - /// - /// Gets or sets a boolean value allowing the API to, if necessary, realod the driver (for Vista and above only). Will - /// not be persisted. Value undefined on get. - /// - public bool DriverReloadAllowed { get; set; } - - /// - /// Gets the topology Frequency - /// - public int Frequency { get; private set; } - - /// - /// Gets or sets a boolean value enabling as immersive gaming instead of Mosaic SLI (for Quadro-boards only) - /// - public bool ImmersiveGaming { get; set; } - - /// - /// Gets the topology resolution - /// - public Resolution Resolution { get; private set; } - - /// - /// Gets the mosaic rows - /// - public int Rows { get; private set; } - - /// - public bool Equals(GridTopology other) - { - if (ReferenceEquals(null, other)) - { - return false; - } - - if (ReferenceEquals(this, other)) - { - return true; - } - - return Resolution.Equals(other.Resolution) && - Frequency == other.Frequency && - Rows == other.Rows && - Columns == other.Columns && - Displays.SequenceEqual(other.Displays) && - ApplyWithBezelCorrectedResolution == other.ApplyWithBezelCorrectedResolution && - ImmersiveGaming == other.ImmersiveGaming && - BaseMosaicPanoramic == other.BaseMosaicPanoramic && - AcceleratePrimaryDisplay == other.AcceleratePrimaryDisplay; - } - - /// - /// Retrieves a list of currently active mosaic grid topologies - /// - /// An array of GridTopology objects - public static GridTopology[] GetGridTopologies() - { - return MosaicApi.EnumDisplayGrids().Select(topology => new GridTopology(topology)).ToArray(); - } - - /// - /// Checks for equality between two objects of same type - /// - /// The first object - /// The second object - /// true, if both objects are equal, otherwise false - public static bool operator ==(GridTopology left, GridTopology right) - { - return right?.Equals(left) ?? ReferenceEquals(left, null); - } - - /// - /// Checks for inequality between two objects of same type - /// - /// The first object - /// The second object - /// true, if both objects are not equal, otherwise false - public static bool operator !=(GridTopology left, GridTopology right) - { - return !(left == right); - } - - /// - /// Applies the requested grid topologies - /// - /// An array of grid topologies to apply - /// SetDisplayTopologyFlag flag - public static void SetGridTopologies( - GridTopology[] grids, - SetDisplayTopologyFlag flags = SetDisplayTopologyFlag.NoFlag) - { - var gridTopologyV2 = grids.Select(grid => grid.GetGridTopologyV2()).Cast().ToArray(); - - try - { - MosaicApi.SetDisplayGrids(gridTopologyV2, flags); - } - catch (NVIDIAApiException ex) - { - if (ex.Status != Status.IncompatibleStructureVersion) - { - throw; - } - } - catch (NVIDIANotSupportedException) - { - // ignore - } - - var gridTopologyV1 = grids.Select(grid => grid.GetGridTopologyV1()).Cast().ToArray(); - MosaicApi.SetDisplayGrids(gridTopologyV1, flags); - } - - /// - /// Validates a list of grid topologies - /// - /// An array of grid topologies to validate - /// SetDisplayTopologyFlag flag - /// An array of DisplayTopologyStatus object containing the result of the validation - public static DisplayTopologyStatus[] ValidateGridTopologies( - GridTopology[] grids, - SetDisplayTopologyFlag flags = SetDisplayTopologyFlag.AllowInvalid) - { - var gridTopologyV2 = grids.Select(grid => grid.GetGridTopologyV2()).Cast().ToArray(); - - try - { - return MosaicApi.ValidateDisplayGrids(gridTopologyV2, flags); - } - catch (NVIDIAApiException ex) - { - if (ex.Status != Status.IncompatibleStructureVersion) - { - throw; - } - } - catch (NVIDIANotSupportedException) - { - // ignore - } - - var gridTopologyV1 = grids.Select(grid => grid.GetGridTopologyV1()).Cast().ToArray(); - - return MosaicApi.ValidateDisplayGrids(gridTopologyV1, flags); - } - - /// - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) - { - return false; - } - - if (ReferenceEquals(this, obj)) - { - return true; - } - - if (obj.GetType() != GetType()) - { - return false; - } - - return Equals((GridTopology) obj); - } - - /// - public override int GetHashCode() - { - unchecked - { - var hashCode = Resolution.GetHashCode(); - hashCode = (hashCode * 397) ^ Frequency; - hashCode = (hashCode * 397) ^ Rows; - hashCode = (hashCode * 397) ^ Columns; - hashCode = (hashCode * 397) ^ (Displays?.GetHashCode() ?? 0); - hashCode = (hashCode * 397) ^ ApplyWithBezelCorrectedResolution.GetHashCode(); - hashCode = (hashCode * 397) ^ ImmersiveGaming.GetHashCode(); - hashCode = (hashCode * 397) ^ BaseMosaicPanoramic.GetHashCode(); - hashCode = (hashCode * 397) ^ AcceleratePrimaryDisplay.GetHashCode(); - - return hashCode; - } - } - - /// - /// Creates and fills a DisplaySettingsV1 object - /// - /// The newly created DisplaySettingsV1 object - public DisplaySettingsV1 GetDisplaySettingsV1() - { - return new DisplaySettingsV1(Resolution.Width, Resolution.Height, Resolution.ColorDepth, Frequency); - } - - /// - /// Creates and fills a GridTopologyV1 object - /// - /// The newly created GridTopologyV1 object - public GridTopologyV1 GetGridTopologyV1() - { - var displaySettings = GetDisplaySettingsV1(); - - return new GridTopologyV1(Rows, Columns, - Displays.Select(display => display.GetGridTopologyDisplayV1()).ToArray(), displaySettings, - ApplyWithBezelCorrectedResolution, ImmersiveGaming, BaseMosaicPanoramic, DriverReloadAllowed, - AcceleratePrimaryDisplay); - } - - /// - /// Creates and fills a GridTopologyV2 object - /// - /// The newly created GridTopologyV2 object - public GridTopologyV2 GetGridTopologyV2() - { - var displaySettings = GetDisplaySettingsV1(); - - return new GridTopologyV2(Rows, Columns, - Displays.Select(display => display.GetGridTopologyDisplayV2()).ToArray(), displaySettings, - ApplyWithBezelCorrectedResolution, ImmersiveGaming, BaseMosaicPanoramic, DriverReloadAllowed, - AcceleratePrimaryDisplay, - Displays.Any(display => display.PixelShiftType != PixelShiftType.NoPixelShift)); - } - - /// - /// Retrieves a list of possible display settings for this topology - /// - /// An array of IDisplaySettings implamented objects - public IDisplaySettings[] GetPossibleDisplaySettings() - { - var gridTopologyV2 = GetGridTopologyV2(); - - try - { - return MosaicApi.EnumDisplayModes(gridTopologyV2); - } - catch (NVIDIAApiException ex) - { - if (ex.Status != Status.IncompatibleStructureVersion) - { - throw; - } - } - catch (NVIDIANotSupportedException) - { - // ignore - } - - var gridTopologyV1 = GetGridTopologyV1(); - - return MosaicApi.EnumDisplayModes(gridTopologyV1); - } - - /// - /// Changes topology arrangement and displays - /// - /// Mosaic rows - /// Mosaic columns - /// Topology displays - /// Invalid display arrangement. - /// Number of displays should match the arrangement. - public void SetDisplays(int rows, int columns, GridTopologyDisplay[] displays) - { - if (rows * columns <= 0) - { - throw new ArgumentOutOfRangeException($"{nameof(rows)}, {nameof(columns)}", - "Invalid display arrangement."); - } - - if (displays.Length != rows * columns) - { - throw new ArgumentException("Number of displays should match the arrangement.", nameof(displays)); - } - - Rows = rows; - Columns = columns; - Displays = displays; - } - - /// - /// Changes display settings for the topology - /// - /// Display settings to use - public void SetDisplaySettings(IDisplaySettings displaySettings) - { - Resolution = new Resolution(displaySettings.Width, displaySettings.Height, displaySettings.BitsPerPixel); - Frequency = displaySettings.Frequency; - } - } -} \ No newline at end of file diff --git a/app/NvAPIWrapper/Mosaic/GridTopologyDisplay.cs b/app/NvAPIWrapper/Mosaic/GridTopologyDisplay.cs deleted file mode 100644 index e82cadd8..00000000 --- a/app/NvAPIWrapper/Mosaic/GridTopologyDisplay.cs +++ /dev/null @@ -1,192 +0,0 @@ -using System; -using NvAPIWrapper.Display; -using NvAPIWrapper.Native.Display; -using NvAPIWrapper.Native.Interfaces.Mosaic; -using NvAPIWrapper.Native.Mosaic; -using NvAPIWrapper.Native.Mosaic.Structures; - -namespace NvAPIWrapper.Mosaic -{ - /// - /// Represents a display in a mosaic grid topology - /// - public class GridTopologyDisplay : IEquatable - { - /// - /// Creates a mew GridTopologyDisplay - /// - /// Corresponding display identification - /// The overlap values - /// The display rotation - /// The display clone group - /// The display pixel shift type - public GridTopologyDisplay( - uint displayId, - Overlap overlap = default(Overlap), - Rotate rotation = Rotate.Degree0, - uint cloneGroup = 0, - PixelShiftType pixelShiftType = PixelShiftType.NoPixelShift) - : this(new DisplayDevice(displayId), overlap, rotation, cloneGroup, pixelShiftType) - { - } - - /// - /// Creates a mew GridTopologyDisplay - /// - /// Corresponding display device - /// The overlap values - /// The display rotation - /// The display clone group - /// The display pixel shift type - public GridTopologyDisplay( - DisplayDevice display, - Overlap overlap = default(Overlap), - Rotate rotation = Rotate.Degree0, - uint cloneGroup = 0, - PixelShiftType pixelShiftType = PixelShiftType.NoPixelShift) - { - DisplayDevice = display; - Overlap = overlap; - Rotation = rotation; - CloneGroup = cloneGroup; - PixelShiftType = pixelShiftType; - } - - /// - /// Creates a mew GridTopologyDisplay - /// - /// IGridTopologyDisplay implamented object - public GridTopologyDisplay(IGridTopologyDisplay gridTopologyDisplay) - : this( - new DisplayDevice(gridTopologyDisplay.DisplayId), - new Overlap(gridTopologyDisplay.OverlapX, gridTopologyDisplay.OverlapY), - gridTopologyDisplay.Rotation, gridTopologyDisplay.CloneGroup, gridTopologyDisplay.PixelShiftType) - { - } - - /// - /// Gets the clone group identification; Reserved, must be 0 - /// - public uint CloneGroup { get; set; } - - /// - /// Gets the corresponding DisplayDevice - /// - public DisplayDevice DisplayDevice { get; } - - /// - /// Gets the overlap values - /// - public Overlap Overlap { get; set; } - - /// - /// Gets the type of display pixel shift - /// - public PixelShiftType PixelShiftType { get; set; } - - /// - /// Gets the rotation of the display - /// - public Rotate Rotation { get; set; } - - /// - public bool Equals(GridTopologyDisplay other) - { - if (ReferenceEquals(null, other)) - { - return false; - } - - if (ReferenceEquals(this, other)) - { - return true; - } - - return DisplayDevice.Equals(other.DisplayDevice) && - Overlap.Equals(other.Overlap) && - Rotation == other.Rotation && - CloneGroup == other.CloneGroup && - PixelShiftType == other.PixelShiftType; - } - - /// - /// Checks for equality between two objects of same type - /// - /// The first object - /// The second object - /// true, if both objects are equal, otherwise false - public static bool operator ==(GridTopologyDisplay left, GridTopologyDisplay right) - { - return right?.Equals(left) ?? ReferenceEquals(left, null); - } - - /// - /// Checks for inequality between two objects of same type - /// - /// The first object - /// The second object - /// true, if both objects are not equal, otherwise false - public static bool operator !=(GridTopologyDisplay left, GridTopologyDisplay right) - { - return !(left == right); - } - - /// - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) - { - return false; - } - - if (ReferenceEquals(this, obj)) - { - return true; - } - - if (obj.GetType() != GetType()) - { - return false; - } - - return Equals((GridTopologyDisplay) obj); - } - - /// - public override int GetHashCode() - { - unchecked - { - var hashCode = DisplayDevice?.GetHashCode() ?? 0; - hashCode = (hashCode * 397) ^ Overlap.GetHashCode(); - hashCode = (hashCode * 397) ^ (int) Rotation; - hashCode = (hashCode * 397) ^ (int) CloneGroup; - hashCode = (hashCode * 397) ^ (int) PixelShiftType; - - return hashCode; - } - } - - /// - /// Creates and fills a GridTopologyDisplayV1 object - /// - /// The newly created GridTopologyDisplayV1 object - public GridTopologyDisplayV1 GetGridTopologyDisplayV1() - { - return new GridTopologyDisplayV1(DisplayDevice.DisplayId, Overlap.HorizontalOverlap, - Overlap.VerticalOverlap, - Rotation, CloneGroup); - } - - /// - /// Creates and fills a GridTopologyDisplayV2 object - /// - /// The newly created GridTopologyDisplayV2 object - public GridTopologyDisplayV2 GetGridTopologyDisplayV2() - { - return new GridTopologyDisplayV2(DisplayDevice.DisplayId, Overlap.HorizontalOverlap, - Overlap.VerticalOverlap, - Rotation, CloneGroup, PixelShiftType); - } - } -} \ No newline at end of file diff --git a/app/NvAPIWrapper/Mosaic/Overlap.cs b/app/NvAPIWrapper/Mosaic/Overlap.cs deleted file mode 100644 index 86d19a15..00000000 --- a/app/NvAPIWrapper/Mosaic/Overlap.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; - -namespace NvAPIWrapper.Mosaic -{ - /// - /// Holds mosaic overlap values - /// - public struct Overlap : IEquatable - { - /// - /// Creates a new Overlap - /// - /// Horizontal overlap - /// Vertical overlap - public Overlap(int overlapX, int overlapY) - { - HorizontalOverlap = overlapX; - VerticalOverlap = overlapY; - } - - /// - /// Gets or sets horizontal overlap (OverlapX) - /// - public int HorizontalOverlap { get; } - - /// - /// Gets or sets vertical overlap (OverlapY) - /// - public int VerticalOverlap { get; } - - /// - public bool Equals(Overlap other) - { - return HorizontalOverlap == other.HorizontalOverlap && VerticalOverlap == other.VerticalOverlap; - } - - /// - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) - { - return false; - } - - return obj is Overlap && Equals((Overlap) obj); - } - - /// - public override int GetHashCode() - { - unchecked - { - return (HorizontalOverlap * 397) ^ VerticalOverlap; - } - } - - /// - /// Checks for equality between two objects of same type - /// - /// The first object - /// The second object - /// true, if both objects are equal, otherwise false - public static bool operator ==(Overlap left, Overlap right) - { - return left.Equals(right); - } - - /// - /// Checks for inequality between two objects of same type - /// - /// The first object - /// The second object - /// true, if both objects are not equal, otherwise false - public static bool operator !=(Overlap left, Overlap right) - { - return !left.Equals(right); - } - - /// - public override string ToString() - { - return $"({HorizontalOverlap}, {VerticalOverlap})"; - } - } -} \ No newline at end of file diff --git a/app/NvAPIWrapper/Mosaic/OverlapLimit.cs b/app/NvAPIWrapper/Mosaic/OverlapLimit.cs deleted file mode 100644 index 3fcac04f..00000000 --- a/app/NvAPIWrapper/Mosaic/OverlapLimit.cs +++ /dev/null @@ -1,131 +0,0 @@ -using System; - -namespace NvAPIWrapper.Mosaic -{ - /// - /// Holds maximum and minimum possible values for overlaps - /// - public struct OverlapLimit : IEquatable - { - internal OverlapLimit(int minOverlapX, int maxOverlapX, int minOverlapY, int maxOverlapY) - { - MinimumHorizontalOverlap = minOverlapX; - MaximumHorizontalOverlap = maxOverlapX; - MinimumVerticalOverlap = minOverlapY; - MaximumVerticalOverlap = maxOverlapY; - } - - /// - /// Minimum value for horizontal overlap (OverlapX) or maximum value of horizontal gap - /// - public int MinimumHorizontalOverlap { get; } - - /// - /// Maximum value for horizontal overlap (OverlapX) - /// - public int MaximumHorizontalOverlap { get; } - - /// - /// Minimum value for vertical overlap (OverlapY) or maximum value of vertical gap - /// - public int MinimumVerticalOverlap { get; } - - /// - /// Maximum value for vertical overlap (OverlapY) - /// - public int MaximumVerticalOverlap { get; } - - /// - public bool Equals(OverlapLimit other) - { - return MinimumHorizontalOverlap == other.MinimumHorizontalOverlap && - MaximumHorizontalOverlap == other.MaximumHorizontalOverlap && - MinimumVerticalOverlap == other.MinimumVerticalOverlap && - MaximumVerticalOverlap == other.MaximumVerticalOverlap; - } - - /// - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) - { - return false; - } - - return obj is OverlapLimit && Equals((OverlapLimit) obj); - } - - /// - public override int GetHashCode() - { - unchecked - { - var hashCode = MinimumHorizontalOverlap; - hashCode = (hashCode * 397) ^ MaximumHorizontalOverlap; - hashCode = (hashCode * 397) ^ MinimumVerticalOverlap; - hashCode = (hashCode * 397) ^ MaximumVerticalOverlap; - - return hashCode; - } - } - - /// - /// Checks for equality between two objects of same type - /// - /// The first object - /// The second object - /// true, if both objects are equal, otherwise false - public static bool operator ==(OverlapLimit left, OverlapLimit right) - { - return left.Equals(right); - } - - /// - /// Checks for inequality between two objects of same type - /// - /// The first object - /// The second object - /// true, if both objects are not equal, otherwise false - public static bool operator !=(OverlapLimit left, OverlapLimit right) - { - return !left.Equals(right); - } - - /// - public override string ToString() - { - return - $"[{MinimumHorizontalOverlap}, {MaximumHorizontalOverlap}], [{MinimumVerticalOverlap}, {MaximumVerticalOverlap}]"; - } - - /// - /// Checks to see if the value falls in to the acceptable horizontal overlap range - /// - /// The horizontal overlap value - /// true if the value falls into the range, otherwise false - public bool IsInHorizontalRange(int overlapX) - { - return overlapX >= MinimumHorizontalOverlap && overlapX <= MaximumHorizontalOverlap; - } - - /// - /// Checks to see if the value falls in to the acceptable vertical overlap range - /// - /// The vertical overlap value - /// true if the value falls into the range, otherwise false - public bool IsInVerticalRange(int overlapY) - { - return overlapY >= MinimumVerticalOverlap && overlapY <= MaximumVerticalOverlap; - } - - /// - /// Checks to see if the overlap values fall in to the acceptable overlap ranges - /// - /// The overlap values - /// true if the values fall into the range, otherwise false - public bool IsInRange(Overlap overlap) - { - return IsInHorizontalRange(overlap.HorizontalOverlap) && IsInVerticalRange(overlap.VerticalOverlap); - } - } -} \ No newline at end of file diff --git a/app/NvAPIWrapper/Mosaic/Topology.cs b/app/NvAPIWrapper/Mosaic/Topology.cs deleted file mode 100644 index 00245827..00000000 --- a/app/NvAPIWrapper/Mosaic/Topology.cs +++ /dev/null @@ -1,361 +0,0 @@ -using System; -using System.Linq; -using NvAPIWrapper.Native; -using NvAPIWrapper.Native.Display.Structures; -using NvAPIWrapper.Native.Exceptions; -using NvAPIWrapper.Native.General; -using NvAPIWrapper.Native.Interfaces.Mosaic; -using NvAPIWrapper.Native.Mosaic; -using NvAPIWrapper.Native.Mosaic.Structures; - -namespace NvAPIWrapper.Mosaic -{ - /// - /// Represents a mosaic topology - /// - [Obsolete("Using Mosaic API Phase 1, please consider using TopologyGrid class on newer drivers", false)] - public class Topology : IEquatable - { - /// - /// Creates a new Topology - /// - /// Mosaic displays resolution - /// Mosaic displays frequency - /// Topology arrangement - /// Mosaic overlap - public Topology( - Resolution resolution, - int frequency, - Native.Mosaic.Topology topology, - Overlap overlap) - { - Resolution = resolution; - Frequency = frequency; - FrequencyInMillihertz = (uint) (Frequency * 1000); - TopologyMode = topology; - Overlap = overlap; - } - - /// - /// Creates a new Topology - /// - /// >Mosaic displays resolution - /// Mosaic frequency - /// Mosaic frequency x 1000 - /// Topology arrangement - /// Mosaic overlap - public Topology( - Resolution resolution, - int frequency, - uint frequencyInMillihertz, - Native.Mosaic.Topology topology, - Overlap overlap) - : this(resolution, frequency, topology, overlap) - { - FrequencyInMillihertz = frequencyInMillihertz; - } - - /// - /// Gets the mosaic displays frequency - /// - public int Frequency { get; } - - /// - /// Gets the mosaic displays frequency x 1000 (Millihertz) - /// - public uint FrequencyInMillihertz { get; } - - /// - /// Gets the topology overlap - /// - public Overlap Overlap { get; } - - /// - /// Gets the mosaic displays resolution - /// - public Resolution Resolution { get; } - - /// - /// Gets the topology arrangement - /// - public Native.Mosaic.Topology TopologyMode { get; } - - /// - public bool Equals(Topology other) - { - if (ReferenceEquals(null, other)) - { - return false; - } - - if (ReferenceEquals(this, other)) - { - return true; - } - - return Resolution.Equals(other.Resolution) && - Frequency == other.Frequency && - FrequencyInMillihertz == other.FrequencyInMillihertz && - TopologyMode == other.TopologyMode && - Overlap.Equals(other.Overlap); - } - - /// - /// Disables the current topology - /// - public static void DisableCurrent() - { - MosaicApi.EnableCurrentTopology(false); - } - - /// - /// Enables the current topology - /// - public static void EnableCurrent() - { - MosaicApi.EnableCurrentTopology(true); - } - - /// - /// Returns the current topology settings - /// - /// The current Topology object - public static Topology GetCurrentTopology() - { - TopologyBrief brief; - IDisplaySettings displaySettings; - int overlapX; - int overlapY; - MosaicApi.GetCurrentTopology(out brief, out displaySettings, out overlapX, out overlapY); - - return - new Topology( - new Resolution(displaySettings.Width, displaySettings.Height, displaySettings.BitsPerPixel), - displaySettings.Frequency, displaySettings.FrequencyInMillihertz, brief.Topology, - new Overlap(overlapX, overlapY)); - } - - /// - /// Retrieves all the supported topology modes that are now possible to apply - /// - /// The type of the topology mode to limit quary - /// An array of Topology modes - public static Native.Mosaic.Topology[] GetSupportedTopologyModes(TopologyType type = TopologyType.All) - { - return - MosaicApi.GetSupportedTopologiesInfo(type) - .TopologyBriefs.Where(topologyBrief => topologyBrief.IsPossible) - .Select(topologyBrief => topologyBrief.Topology) - .ToArray(); - } - - - /// - /// Retrieves all the supported display settings - /// - /// The type of the topology mode to limit quary - /// An array of IDisplaySettings implamented objects - public static IDisplaySettings[] GetSupportedTopologySettings(TopologyType type = TopologyType.All) - { - return MosaicApi.GetSupportedTopologiesInfo(type).DisplaySettings.ToArray(); - } - - /// - /// Indicates if the current topology is now active - /// - /// true if the current topology is now enable, otherwise false - public static bool IsCurrentTopologyEnabled() - { - TopologyBrief brief; - IDisplaySettings displaySettings; - int overlapX; - int overlapY; - MosaicApi.GetCurrentTopology(out brief, out displaySettings, out overlapX, out overlapY); - - return brief.IsEnable; - } - - /// - /// Indicates if the current topology is possible to apply - /// - /// true if the current topology is possible to apply, otherwise false - public static bool IsCurrentTopologyPossible() - { - TopologyBrief brief; - IDisplaySettings displaySettings; - int overlapX; - int overlapY; - MosaicApi.GetCurrentTopology(out brief, out displaySettings, out overlapX, out overlapY); - - return brief.IsPossible; - } - - /// - /// Checks for equality between two objects of same type - /// - /// The first object - /// The second object - /// true, if both objects are equal, otherwise false - public static bool operator ==(Topology left, Topology right) - { - return right?.Equals(left) ?? ReferenceEquals(left, null); - } - - /// - /// Checks for inequality between two objects of same type - /// - /// The first object - /// The second object - /// true, if both objects are not equal, otherwise false - public static bool operator !=(Topology left, Topology right) - { - return !(left == right); - } - - /// - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) - { - return false; - } - - if (ReferenceEquals(this, obj)) - { - return true; - } - - if (obj.GetType() != GetType()) - { - return false; - } - - return Equals((Topology) obj); - } - - /// - public override int GetHashCode() - { - unchecked - { - var hashCode = Resolution.GetHashCode(); - hashCode = (hashCode * 397) ^ Frequency; - hashCode = (hashCode * 397) ^ (int) FrequencyInMillihertz; - hashCode = (hashCode * 397) ^ (int) TopologyMode; - hashCode = (hashCode * 397) ^ Overlap.GetHashCode(); - - return hashCode; - } - } - - /// - /// Retrieves topology details - /// - /// An array of TopologyDetails - public TopologyDetails[] GetDetails() - { - var brief = GetTopologyBrief(); - - return - MosaicApi.GetTopologyGroup(brief) - .TopologyDetails.Select(detail => new TopologyDetails(detail)) - .ToArray(); - } - - /// - /// Creates and fills a DisplaySettingsV1 object - /// - /// The newly created DisplaySettingsV1 object - public DisplaySettingsV1 GetDisplaySettingsV1() - { - return new DisplaySettingsV1(Resolution.Width, Resolution.Height, Resolution.ColorDepth, Frequency); - } - - /// - /// Creates and fills a DisplaySettingsV2 object - /// - /// The newly created DisplaySettingsV2 object - public DisplaySettingsV2 GetDisplaySettingsV2() - { - return new DisplaySettingsV2(Resolution.Width, Resolution.Height, Resolution.ColorDepth, Frequency, - FrequencyInMillihertz); - } - - /// - /// Retrieve the topology overlap limits - /// - /// - public OverlapLimit GetOverlapLimits() - { - int minX; - int maxX; - int minY; - int maxY; - var brief = GetTopologyBrief(); - var displaySettingsV2 = GetDisplaySettingsV2(); - - try - { - MosaicApi.GetOverlapLimits(brief, displaySettingsV2, out minX, out maxX, out minY, out maxY); - - return new OverlapLimit(minX, maxX, minY, maxY); - } - catch (NVIDIAApiException ex) - { - if (ex.Status != Status.IncompatibleStructureVersion) - { - throw; - } - } - catch (NVIDIANotSupportedException) - { - // ignore - } - - var displaySettingsV1 = GetDisplaySettingsV1(); - MosaicApi.GetOverlapLimits(brief, displaySettingsV1, out minX, out maxX, out minY, out maxY); - - return new OverlapLimit(minX, maxX, minY, maxY); - } - - /// - /// Creates and fills a TopologyBrief object - /// - /// The newly created TopologyBrief object - public TopologyBrief GetTopologyBrief() - { - return new TopologyBrief(TopologyMode); - } - - /// - /// Sets this topology as the current topology - /// - /// if true, will apply the topology right now - public void SetAsCurrentTopology(bool apply = false) - { - var brief = GetTopologyBrief(); - var displaySettingsV2 = GetDisplaySettingsV2(); - - try - { - MosaicApi.SetCurrentTopology(brief, displaySettingsV2, Overlap.HorizontalOverlap, - Overlap.VerticalOverlap, apply); - } - catch (NVIDIAApiException ex) - { - if (ex.Status != Status.IncompatibleStructureVersion) - { - throw; - } - } - catch (NVIDIANotSupportedException) - { - // ignore - } - - var displaySettingsV1 = GetDisplaySettingsV1(); - MosaicApi.SetCurrentTopology(brief, displaySettingsV1, Overlap.HorizontalOverlap, Overlap.VerticalOverlap, - apply); - } - } -} \ No newline at end of file diff --git a/app/NvAPIWrapper/Mosaic/TopologyDetails.cs b/app/NvAPIWrapper/Mosaic/TopologyDetails.cs deleted file mode 100644 index 522f77b1..00000000 --- a/app/NvAPIWrapper/Mosaic/TopologyDetails.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System; -using System.Linq; -using NvAPIWrapper.GPU; -using NvAPIWrapper.Native.Mosaic; - -namespace NvAPIWrapper.Mosaic -{ - /// - /// Holds extra information about a topology - /// - public class TopologyDetails : IEquatable - { - internal TopologyDetails(Native.Mosaic.Structures.TopologyDetails details) - { - Rows = details.Rows; - Columns = details.Columns; - LogicalGPU = !details.LogicalGPUHandle.IsNull ? new LogicalGPU(details.LogicalGPUHandle) : null; - ValidityFlags = details.ValidityFlags; - Displays = - details.Layout.Select(cells => cells.Select(cell => new TopologyDisplay(cell)).ToArray()).ToArray(); - } - - /// - /// Gets the number of columns in the topology - /// - public int Columns { get; } - - /// - /// Gets the list of topology displays - /// - public TopologyDisplay[][] Displays { get; } - - /// - /// Gets the logical GPU in charge of controling the topology - /// - public LogicalGPU LogicalGPU { get; } - - /// - /// Gets the number of rows in the topology - /// - public int Rows { get; } - - /// - /// Gets the validity status of this topology - /// - public TopologyValidity ValidityFlags { get; } - - /// - public bool Equals(TopologyDetails other) - { - if (ReferenceEquals(null, other)) - { - return false; - } - - if (ReferenceEquals(this, other)) - { - return true; - } - - return Rows == other.Rows && - Columns == other.Columns && - LogicalGPU.Equals(other.LogicalGPU) && - Displays.SequenceEqual(other.Displays); - } - - /// - /// Checks for equality between two objects of same type - /// - /// The first object - /// The second object - /// true, if both objects are equal, otherwise false - public static bool operator ==(TopologyDetails left, TopologyDetails right) - { - return right?.Equals(left) ?? ReferenceEquals(left, null); - } - - /// - /// Checks for inequality between two objects of same type - /// - /// The first object - /// The second object - /// true, if both objects are not equal, otherwise false - public static bool operator !=(TopologyDetails left, TopologyDetails right) - { - return !(left == right); - } - - /// - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) - { - return false; - } - - if (ReferenceEquals(this, obj)) - { - return true; - } - - if (obj.GetType() != GetType()) - { - return false; - } - - return Equals((TopologyDetails) obj); - } - - /// - public override int GetHashCode() - { - unchecked - { - var hashCode = Rows; - hashCode = (hashCode * 397) ^ Columns; - hashCode = (hashCode * 397) ^ (LogicalGPU != null ? LogicalGPU.GetHashCode() : 0); - hashCode = (hashCode * 397) ^ (Displays?.GetHashCode() ?? 0); - - return hashCode; - } - } - } -} \ No newline at end of file diff --git a/app/NvAPIWrapper/Mosaic/TopologyDisplay.cs b/app/NvAPIWrapper/Mosaic/TopologyDisplay.cs deleted file mode 100644 index 72e8deba..00000000 --- a/app/NvAPIWrapper/Mosaic/TopologyDisplay.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System; -using NvAPIWrapper.GPU; - -namespace NvAPIWrapper.Mosaic -{ - /// - /// Holds information about a display in a topology - /// - public class TopologyDisplay : IEquatable - { - internal TopologyDisplay(Native.Mosaic.Structures.TopologyDetails.LayoutCell layoutCell) - { - PhysicalGPU = !layoutCell.PhysicalGPUHandle.IsNull ? new PhysicalGPU(layoutCell.PhysicalGPUHandle) : null; - Output = new GPUOutput(layoutCell.DisplayOutputId, PhysicalGPU); - Overlap = new Overlap(layoutCell.OverlapX, layoutCell.OverlapY); - } - - /// - /// Gets the GPU output used for this display - /// - public GPUOutput Output { get; } - - /// - /// Gets the display overlap values - /// - public Overlap Overlap { get; } - - /// - /// Gets the corresponding physical GPU of this display - /// - public PhysicalGPU PhysicalGPU { get; } - - /// - public bool Equals(TopologyDisplay other) - { - if (ReferenceEquals(null, other)) - { - return false; - } - - if (ReferenceEquals(this, other)) - { - return true; - } - - return PhysicalGPU.Equals(other.PhysicalGPU) && - Output.Equals(other.Output) && - Overlap.Equals(other.Overlap); - } - - /// - /// Checks for equality between two objects of same type - /// - /// The first object - /// The second object - /// true, if both objects are equal, otherwise false - public static bool operator ==(TopologyDisplay left, TopologyDisplay right) - { - return right?.Equals(left) ?? ReferenceEquals(left, null); - } - - /// - /// Checks for inequality between two objects of same type - /// - /// The first object - /// The second object - /// true, if both objects are not equal, otherwise false - public static bool operator !=(TopologyDisplay left, TopologyDisplay right) - { - return !(left == right); - } - - /// - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) - { - return false; - } - - if (ReferenceEquals(this, obj)) - { - return true; - } - - if (obj.GetType() != GetType()) - { - return false; - } - - return Equals((TopologyDisplay) obj); - } - - /// - public override int GetHashCode() - { - unchecked - { - var hashCode = PhysicalGPU != null ? PhysicalGPU.GetHashCode() : 0; - hashCode = (hashCode * 397) ^ (Output != null ? Output.GetHashCode() : 0); - hashCode = (hashCode * 397) ^ Overlap.GetHashCode(); - - return hashCode; - } - } - } -} \ No newline at end of file diff --git a/app/NvAPIWrapper/Stereo/StereoApplicationConfiguration.cs b/app/NvAPIWrapper/Stereo/StereoApplicationConfiguration.cs deleted file mode 100644 index cee3c4f9..00000000 --- a/app/NvAPIWrapper/Stereo/StereoApplicationConfiguration.cs +++ /dev/null @@ -1,155 +0,0 @@ -using System; -using NvAPIWrapper.Native; -using NvAPIWrapper.Native.Stereo; -using NvAPIWrapper.Native.Stereo.Structures; - -namespace NvAPIWrapper.Stereo -{ - /// - /// Represents an application registry configuration profile as well as providing static access to system-wide and - /// application-wide stereo configurations. - /// - public class StereoApplicationConfiguration - { - private StereoApplicationConfiguration(StereoRegistryProfileType profileType) - { - ProfileType = profileType; - StereoApi.CreateConfigurationProfileRegistryKey(profileType); - } - - /// - /// Gets the default configuration profile for the current application - /// - public static StereoApplicationConfiguration DefaultConfigurationProfile { get; } = - new StereoApplicationConfiguration(StereoRegistryProfileType.DefaultProfile); - - /// - /// Gets the currently default profile name. - /// - public static string DefaultProfile - { - get => StereoApi.GetDefaultProfile(); - } - - /// - /// Gets the DirectX 10 configuration profile for the current application. - /// Use this property if only your application supports multiple DirectX versions. - /// Otherwise consider using the property. - /// - public static StereoApplicationConfiguration DirectX10ConfigurationProfile { get; } = - new StereoApplicationConfiguration(StereoRegistryProfileType.DirectX10Profile); - - /// - /// Gets the DirectX 9 configuration profile for the current application. - /// Use this property if only your application supports multiple DirectX versions. - /// Otherwise consider using the property. - /// - public static StereoApplicationConfiguration DirectX9ConfigurationProfile { get; } = - new StereoApplicationConfiguration(StereoRegistryProfileType.DirectX9Profile); - - /// - /// Gets a boolean value indicating if the stereo mode is enable in the registry. - /// - public static bool IsStereoEnable - { - get => StereoApi.IsStereoEnabled(); - } - - /// - /// Gets a boolean value indicating if the windowed mode stereo is supported - /// - public static bool IsWindowedModeSupported - { - get => StereoApi.IsWindowedModeSupported(); - } - - /// - /// Gets the stereo registry profile type associated with this instance. - /// - public StereoRegistryProfileType ProfileType { get; } - - - /// - /// Disables the stereo mode in the registry. The effect is system wide. - /// - public static void DisableStereo() - { - StereoApi.DisableStereo(); - } - - /// - /// Enables the stereo mode in the registry. The effect is system wide. - /// - public static void EnableStereo() - { - StereoApi.EnableStereo(); - } - - /// - /// Gets the monitor capabilities for the passed monitor handle. - /// - /// The monitor handle represented by a pointer. - /// The stereo capabilities of the monitor. - public static StereoCapabilitiesV1 GetMonitorCapabilities(IntPtr monitorHandle) - { - return StereoApi.GetStereoSupport(monitorHandle); - } - - /// - /// Sets the default stereo profile used by the driver in case te application has no associated profile. - /// For the changes to take effect, this method must be called before creating a D3D device. - /// - /// - public static void SetDefaultProfile(string profileName) - { - StereoApi.SetDefaultProfile(profileName); - } - - /// - /// Sets the 3D stereo driver mode. - /// - /// - public static void SetDriverMode(StereoDriverMode driverMode) - { - StereoApi.SetDriverMode(driverMode); - } - - /// - /// Deletes the entire profile's registry key and therefore resets all customized values. - /// - public void DeleteAllValues() - { - StereoApi.DeleteConfigurationProfileRegistryKey(ProfileType); - StereoApi.CreateConfigurationProfileRegistryKey(ProfileType); - } - - /// - /// Removes the given value from the profile's registry key. - /// - /// - public void DeleteValue(StereoRegistryIdentification valueId) - { - StereoApi.DeleteConfigurationProfileValue(ProfileType, valueId); - } - - /// - /// Sets the given value under the profile's registry key. - /// - /// The identification of the value to be set. - /// The actual value being set. - public void SetValue(StereoRegistryIdentification valueId, float value) - { - StereoApi.SetConfigurationProfileValue(ProfileType, valueId, value); - } - - /// - /// Sets the given value under the profile's registry key. - /// - /// The identification of the value to be set. - /// The actual value being set. - public void SetValue(StereoRegistryIdentification valueId, int value) - { - StereoApi.SetConfigurationProfileValue(ProfileType, valueId, value); - } - } -} \ No newline at end of file diff --git a/app/NvAPIWrapper/Stereo/StereoDeviceSession.cs b/app/NvAPIWrapper/Stereo/StereoDeviceSession.cs deleted file mode 100644 index de7c5a38..00000000 --- a/app/NvAPIWrapper/Stereo/StereoDeviceSession.cs +++ /dev/null @@ -1,311 +0,0 @@ -using System; -using NvAPIWrapper.Native; -using NvAPIWrapper.Native.Stereo; -using NvAPIWrapper.Native.Stereo.Structures; - -namespace NvAPIWrapper.Stereo -{ - /// - /// Represents an stereo session created for a D3D device by wrapping over a - /// - public class StereoDeviceSession : IDisposable - { - /// - /// Create a new instance of directly from a - /// - /// The to represent. - public StereoDeviceSession(StereoHandle handle) - { - Handle = handle; - } - - /// - /// Gets and sets the current convergence value - /// - public float Convergence - { - get => StereoApi.GetConvergence(Handle); - set => StereoApi.SetConvergence(Handle, value); - } - - /// - /// Gets the eye separation as a ratio of [between eye distance]/[physical screen width]. - /// - public float EyeSeparation - { - get => StereoApi.GetEyeSeparation(Handle); - } - - /// - /// Gets and sets the current frustum adjust mode value. - /// - public StereoFrustumAdjustMode FrustumAdjustMode - { - get => StereoApi.GetFrustumAdjustMode(Handle); - set => StereoApi.SetFrustumAdjustMode(Handle, value); - } - - /// - /// Gets the underlying represented by this instance of - /// - public StereoHandle Handle { get; private set; } - - /// - /// Gets a boolean value indicating if the stereo is activated. - /// - public bool IsStereoActivated - { - get => StereoApi.IsStereoActivated(Handle); - } - - /// - /// Gets a boolean value indicating if this instance is valid. - /// - public bool IsValid - { - get => !Handle.IsNull; - } - - /// - /// Gets and sets the current separation value in percentage. - /// - public float Separation - { - get => StereoApi.GetSeparation(Handle); - set => StereoApi.SetSeparation(Handle, value); - } - - /// - /// Gets and sets the current surface creation mode - /// - public StereoSurfaceCreateMode SurfaceCreationMode - { - get => StereoApi.GetSurfaceCreationMode(Handle); - set => StereoApi.SetSurfaceCreationMode(Handle, value); - } - - /// - public void Dispose() - { - ReleaseUnmanagedResources(); - GC.SuppressFinalize(this); - } - - /// - /// Creates a new instance of from a D3D Device implementing the IUnknown - /// interface. - /// - /// - /// - // ReSharper disable once InconsistentNaming - public static StereoDeviceSession CreateFromIUnknownD3DDevice(IntPtr d3dDevice) - { - var handle = StereoApi.CreateHandleFromIUnknown(d3dDevice); - - if (handle.IsNull) - { - return null; - } - - return new StereoDeviceSession(handle); - } - - /// - /// Activates stereo for this device. Activating stereo is only possible if stereo is already enabled in the registry. - /// - public void ActivateStereo() - { - StereoApi.ActivateStereo(Handle); - } - - /// - /// Captures the current stereo image in JPEG stereo format with the given quality. Only the last capture call per flip - /// will be effective. - /// - /// Quality of the JPEG image to be captured. Integer value between 0 and 100. - public void CaptureJPEGImage(uint quality) - { - StereoApi.CaptureJpegImage(Handle, quality); - } - - /// - /// Captures the current stereo image in PNG stereo format. Only the last capture call per flip will be effective. - /// - public void CapturePNGImage() - { - StereoApi.CapturePngImage(Handle); - } - - // ReSharper disable once CommentTypo - /// - /// Creates a mono or a stereo swap chain by wrapping the IDXGIFactory::CreateSwapChain method and notifying the device - /// with additional information regarding the stereo swap chain mode selected. - /// - /// - /// A pointer to the swap-chain description (DXGI_SWAP_CHAIN_DESC). This parameter - /// cannot be NULL. - /// - /// - /// A pointer to the swap chain created. - public IntPtr D3D1XCreateSwapChain(IntPtr dxgiSwapChainDescription, StereoSwapChainMode swapChainMode) - { - return StereoApi.D3D1XCreateSwapChain(Handle, dxgiSwapChainDescription, swapChainMode); - } - - // ReSharper disable once CommentTypo - /// - /// Creates a mono or a stereo swap chain by wrapping the IDirect3DDevice9::CreateAdditionalSwapChain method and - /// notifying the device with additional information regarding the stereo swap chain mode selected. - /// - /// A pointer to the swap-chain description (DXGI). This parameter cannot be NULL. - /// - /// A pointer to the swap chain created. - // ReSharper disable once InconsistentNaming - public IntPtr D3D9CreateSwapChain(IntPtr d3dPresentParameters, StereoSwapChainMode swapChainMode) - { - return StereoApi.D3D9CreateSwapChain(Handle, d3dPresentParameters, swapChainMode); - } - - /// - /// Deactivates stereo for this device. - /// - public void DeactivateStereo() - { - StereoApi.DeactivateStereo(Handle); - } - - /// - /// Decreases convergence for this device (just like the Ctrl+F5 hot-key). - /// - public void DecreaseConvergence() - { - StereoApi.DecreaseConvergence(Handle); - } - - /// - /// Decreases separation for this device (just like the Ctrl+F3 hot-key). - /// - public void DecreaseSeparation() - { - StereoApi.DecreaseSeparation(Handle); - } - - /// - /// Increases convergence for this device (just like the Ctrl+F6 hot-key). - /// - public void IncreaseConvergence() - { - StereoApi.IncreaseConvergence(Handle); - } - - /// - /// Increases separation for this device (just like the Ctrl+F4 hot-key). - /// - public void IncreaseSeparation() - { - StereoApi.IncreaseSeparation(Handle); - } - - /// - /// This API allows an application to enable stereo viewing, without the need of a GUID/Key pair - /// This API cannot be used to enable stereo viewing on 3DTV. - /// HOW TO USE: Call this function immediately after device creation, then follow with a reset. \n - /// Very generically: - /// Create Device->Create Stereo Handle->InitActivation->Reset Device - /// - /// Flags to enable or disable delayed activation. - public void InitActivation(StereoActivationFlag activationFlag = StereoActivationFlag.Immediate) - { - StereoApi.InitActivation(Handle, activationFlag); - } - - /// - /// Turns reverse stereo blit on or off. - /// After reversed stereo blit control is turned on, blits from the stereo surface will - /// produce the right-eye image in the left side of the destination surface and the left-eye - /// image in the right side of the destination surface. - /// In DirectX 9, the destination surface must be created as the render target, and StretchRect must be used. - /// Conditions: - /// - DstWidth == 2*SrcWidth - /// - DstHeight == SrcHeight - /// - Src surface is the stereo surface. - /// - SrcRect must be {0,0,SrcWidth,SrcHeight} - /// - DstRect must be {0,0,DstWidth,DstHeight} - /// In DirectX 10, ResourceCopyRegion must be used. - /// Conditions: - /// - DstWidth == 2*SrcWidth - /// - DstHeight == SrcHeight - /// - dstX == 0, - /// - dstY == 0, - /// - dstZ == 0, - /// - SrcBox: left=top=front==0; right==SrcWidth; bottom==SrcHeight; back==1; - /// - /// A boolean value to enable or disable blit control - public void ReverseStereoBlitControl(bool turnOn) - { - StereoApi.ReverseStereoBlitControl(Handle, turnOn); - } - - /// - /// Sets the back buffer to left or right in direct stereo mode. - /// - /// Defines active eye in Direct stereo mode. - public void SetActiveEye(StereoActiveEye activeKey) - { - StereoApi.SetActiveEye(Handle, activeKey); - } - - // ReSharper disable CommentTypo - /// - /// Asks the stereo driver to notify the application with a notification messages - /// when the user changes the stereo driver state. - /// When the user changes the stereo state (Activated or Deactivated, separation or conversion) - /// the stereo driver posts a defined message with the following parameters: - /// lParam is the current conversion. (Actual conversion is *(float*)&lParam ) - /// wParam == MAKEWPARAM(l, h) where - /// - l == 0 if stereo is deactivated - /// - l == 1 if stereo is deactivated - /// - h is the current separation. (Actual separation is float(h*100.f/0xFFFF) - /// Call this API with NULL hWnd to prohibit notification. - /// - /// - /// Window handle that will be notified when the user changes the stereo driver state. Actual - /// handle must be cast to an . - /// - /// MessageID of the message that will be posted to window - public void SetNotificationMessage(ulong windowsHandle, ulong messageId) - { - StereoApi.SetNotificationMessage(Handle, windowsHandle, messageId); - } - - /// - /// Triggers the creation of a stereo desktop in case the creation was stopped on application launch. - /// - public void TriggerActivation() - { - StereoApi.TriggerActivation(Handle); - } - - /// - /// Checks if the last draw call was stereoized. It is a very expensive to call and should be used for debugging - /// purpose *only*. - /// - /// true if the last draw was stereoized; otherwise false. - public bool WasLastDrawStereoizedDebugOnly() - { - return StereoApi.WasLastDrawStereoizedDebug(Handle); - } - - private void ReleaseUnmanagedResources() - { - StereoApi.DestroyHandle(Handle); - Handle = StereoHandle.DefaultHandle; - } - - /// - ~StereoDeviceSession() - { - ReleaseUnmanagedResources(); - } - } -} \ No newline at end of file diff --git a/app/Program.cs b/app/Program.cs index 38a7aedc..22953563 100644 --- a/app/Program.cs +++ b/app/Program.cs @@ -31,8 +31,6 @@ namespace GHelper private static long lastTheme; private static PowerLineStatus isPlugged = PowerLineStatus.Unknown; - public static NvidiaGpuControl nvControl = new NvidiaGpuControl(); - // The main entry point for the application public static void Main(string[] args) { @@ -68,6 +66,8 @@ namespace GHelper Application.EnableVisualStyles(); + HardwareControl.RecreateGpuControl(); + var ds = settingsForm.Handle; trayIcon.MouseClick += TrayIcon_MouseClick; @@ -80,8 +80,6 @@ namespace GHelper SetAutoModes(); - HardwareMonitor.RecreateGpuControl(); - // Subscribing for system power change events SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged; SystemEvents.UserPreferenceChanged += SystemEvents_UserPreferenceChanged; @@ -294,7 +292,12 @@ namespace GHelper if (action == "gpu") { - nvControl.SetClocksFromConfig(); + if (HardwareControl.GpuControl is not null) + { + NvidiaGpuControl nvcontrol = (NvidiaGpuControl)HardwareControl.GpuControl; + nvcontrol.SetClocksFromConfig(); + } + settingsForm.FansToggle(); } } diff --git a/app/Settings.cs b/app/Settings.cs index 228685fb..dff3e027 100644 --- a/app/Settings.cs +++ b/app/Settings.cs @@ -956,33 +956,33 @@ namespace GHelper string gpuTemp = ""; string battery = ""; - HardwareMonitor.ReadSensors(); + HardwareControl.ReadSensors(); - if (HardwareMonitor.cpuTemp > 0) - cpuTemp = ": " + Math.Round((decimal)HardwareMonitor.cpuTemp).ToString() + "°C "; + if (HardwareControl.cpuTemp > 0) + cpuTemp = ": " + Math.Round((decimal)HardwareControl.cpuTemp).ToString() + "°C "; - if (HardwareMonitor.batteryDischarge > 0) - battery = Properties.Strings.Discharging + ": " + Math.Round((decimal)HardwareMonitor.batteryDischarge, 1).ToString() + "W"; + if (HardwareControl.batteryDischarge > 0) + battery = Properties.Strings.Discharging + ": " + Math.Round((decimal)HardwareControl.batteryDischarge, 1).ToString() + "W"; - if (HardwareMonitor.gpuTemp > 0) + if (HardwareControl.gpuTemp > 0) { - gpuTemp = $": {HardwareMonitor.gpuTemp}°C "; + gpuTemp = $": {HardwareControl.gpuTemp}°C "; } Program.settingsForm.BeginInvoke(delegate { - labelCPUFan.Text = "CPU" + cpuTemp + HardwareMonitor.cpuFan; - labelGPUFan.Text = "GPU" + gpuTemp + HardwareMonitor.gpuFan; - if (HardwareMonitor.midFan is not null) - labelMidFan.Text = "Mid" + HardwareMonitor.midFan; + labelCPUFan.Text = "CPU" + cpuTemp + HardwareControl.cpuFan; + labelGPUFan.Text = "GPU" + gpuTemp + HardwareControl.gpuFan; + if (HardwareControl.midFan is not null) + labelMidFan.Text = "Mid" + HardwareControl.midFan; labelBattery.Text = battery; }); - Program.trayIcon.Text = "CPU" + cpuTemp + HardwareMonitor.cpuFan + "\n" - + "GPU" + gpuTemp + HardwareMonitor.gpuFan + + Program.trayIcon.Text = "CPU" + cpuTemp + HardwareControl.cpuFan + "\n" + + "GPU" + gpuTemp + HardwareControl.gpuFan + ((battery.Length > 0) ? ("\n" + battery) : ""); } @@ -1320,7 +1320,7 @@ namespace GHelper if ((GpuAuto && !IsPlugged()) || (ForceGPU && GpuMode == ASUSWmi.GPUModeEco)) { - if (HardwareMonitor.IsUsedGPU()) + if (HardwareControl.IsUsedGPU()) { DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertDGPU, Properties.Strings.AlertDGPUTitle, MessageBoxButtons.YesNo); if (dialogResult == DialogResult.No) return false; @@ -1438,7 +1438,7 @@ namespace GHelper Program.wmi.DeviceSet(ASUSWmi.GPUEco, eco, "GPUEco"); if (eco == 0) - HardwareMonitor.RecreateGpuControlWithDelay(); + HardwareControl.RecreateGpuControlWithDelay(); Program.settingsForm.BeginInvoke(delegate {