Click here to Skip to main content
15,881,709 members
Articles / Desktop Programming / Win32

Overlay using raphook.dll

Rate me:
Please Sign up or sign in to vote.
4.00/5 (3 votes)
21 Sep 2008CPOL2 min read 41.1K   1.4K   12  
A OverlayMgr based on Ray Adam's raphook.dll
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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Comments and Discussions