public AmdDynamicVibranceProxy(IAmdAdapter amdAdapter, List <ApplicationSetting> applicationSettings, ResolutionModeWrapper windowsResolutionSettings)
        {
            _amdAdapter                = amdAdapter;
            _applicationSettings       = applicationSettings;
            _windowsResolutionSettings = windowsResolutionSettings;

            try
            {
                _vibranceInfo = new VibranceInfo();
                if (amdAdapter.IsAvailable())
                {
                    _vibranceInfo.isInitialized = true;
                    amdAdapter.Init();
                }

                if (_vibranceInfo.isInitialized)
                {
                    _hook = WinEventHook.GetInstance();
                    _hook.WinEventHookHandler += OnWinEventHook;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                MessageBox.Show(NvidiaDynamicVibranceProxy.NvapiErrorInitFailed, "vibranceGUI Error",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 2
0
        public AmdDynamicVibranceProxy(IAmdAdapter amdAdapter, List <ApplicationSetting> applicationSettings, Dictionary <string, Tuple <ResolutionModeWrapper, List <ResolutionModeWrapper> > > windowsResolutionSettings)
        {
            _amdAdapter                = amdAdapter;
            _applicationSettings       = applicationSettings;
            _windowsResolutionSettings = windowsResolutionSettings;

            try
            {
                _vibranceInfo = new VibranceInfo();
                if (amdAdapter.IsAvailable())
                {
                    _vibranceInfo.isInitialized = true;
                    amdAdapter.Init();
                }

                if (_vibranceInfo.isInitialized)
                {
                    _hook = WinEventHook.GetInstance();
                    _hook.WinEventHookHandler += OnWinEventHook;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                DialogResult result = MessageBox.Show(NvidiaDynamicVibranceProxy.NvapiErrorInitFailed, "vibranceGUI Error",
                                                      MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                if (result == DialogResult.OK)
                {
                    Process.Start(NvidiaDynamicVibranceProxy.GuideLink);
                }
            }
        }
 public static GraphicsAdapter GetAdapter()
 {
     if (IsAdapterAvailable(_amdDllName))
     {
         IAmdAdapter amdAdapter = Environment.Is64BitOperatingSystem ? (IAmdAdapter) new AmdAdapter64() :new AmdAdapter32();
         if (amdAdapter.IsAvailable())
         {
             return(GraphicsAdapter.Amd);
         }
     }
     if (IsAdapterAvailable(NvidiaDllName))
     {
         return(GraphicsAdapter.Nvidia);
     }
     return(GraphicsAdapter.Unknown);
 }
Exemplo n.º 4
0
        public static GraphicsAdapter GetAdapter()
        {
            string windowsFolder = Environment.GetFolderPath(Environment.SpecialFolder.SystemX86);

            if (File.Exists(Path.Combine(windowsFolder, _amdDllName)) &&
                File.Exists(Path.Combine(windowsFolder, _nvidiaDllName)))
            {
                return(GraphicsAdapter.Ambiguous);
            }
            if (IsAdapterAvailable(_amdDllName))
            {
                IAmdAdapter amdAdapter = Environment.Is64BitOperatingSystem ? (IAmdAdapter) new AmdAdapter64() :new AmdAdapter32();
                if (amdAdapter.IsAvailable())
                {
                    return(GraphicsAdapter.Amd);
                }
            }
            if (IsAdapterAvailable(_nvidiaDllName))
            {
                return(GraphicsAdapter.Nvidia);
            }
            return(GraphicsAdapter.Unknown);
        }