|
using System;
using System.Runtime.InteropServices;
using OverlayMgr;
using OverlayWrapper;
namespace NvidiaPlugin {
/// <summary>
/// Nvidia Plugin
/// </summary>
[Serializable]
public class NvidiaPlugin : IPlugin {
private bool active;
#region IPlugin Members
public string Name {
get { return "Nvidia Support"; }
}
public string Description {
get { return "Gives Access to temperature & co"; }
}
public bool Load() {
return true;
}
public bool Unload() {
return true;
}
public void ShowConfig() {
new Settings().ShowDialog();
}
public bool Active {
get { return active; }
set { active = value; }
}
public void Tick() {
//Temperature
int gpu = 0;
int env = 0;
int limit = 0;
NativeMethods.NvCplGetThermalSettings(0, ref gpu, ref env, ref limit);
Overlay.Data.GPUTemp = gpu;
Overlay.Data.EnvTemp = env;
}
#endregion
#region Nested type: NativeMethods
private class NativeMethods {
[DllImport("nvcpl.dll")]
public static extern bool NvCplGetThermalSettings(uint id, ref int gpu, ref int env, ref int limit);
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.