コード例 #1
0
ファイル: GuiInitializer.cs プロジェクト: neatodev/BmLauncher
        /// <summary>
        ///     Initializes NVIDIA component, only if NVIDIA card is found.
        ///     Sets displayed tooltips accordingly.
        /// </summary>
        private static void initHBAONVIDIA()
        {
            if (!Program.Client.gpInfoLabel.Text.Contains("NVIDIA"))
            {
                Program.Client.amdToolTip.Active     = true;
                Program.Client.amdToolTip.ShowAlways = true;
                Program.Client.nvBox.Enabled         = false;
                logger.Debug("initHBAONVIDIA - initialized hbao+ possibility as false.");
                return;
            }

            if (Program.Client.gpInfoLabel.Text.Contains("NVIDIA") && !WineChecker.IsWine())
            {
                try
                {
                    Program.NvWorker                    = new NvidiaWorker();
                    Program.Client.nvBox.Enabled        = true;
                    Program.Client.nvidiaToolTip.Active = true;
                    logger.Debug("initHBAONVIDIA - initialized hbao+ possibility as true.");
                }
                catch (NVIDIANotSupportedException e)
                {
                    logger.Warn("initHBAONVIDIA - Caught NVIDIANotSupportedException: {0}", e);
                    Program.Client.nvBox.Enabled = false;
                }
            }
            else if (Program.Client.gpInfoLabel.Text.Contains("NVIDIA"))
            {
                Program.Client.nvBox.Enabled        = false;
                Program.Client.nvidiaToolTip.Active = true;
                logger.Debug(
                    "initHBAONVIDIA - initialized hbao+ possibility as false. You're using an NVIDIA card on a Linux machine.");
            }
        }
コード例 #2
0
        private static void setHbaoPlus()
        {
            if (!Program.Client.gpInfoLabel.Text.Contains("NVIDIA") || WineChecker.IsWine())
            {
                return;
            }

            try
            {
                Program.NvWorker.setNVSettings();
            }
            catch (NVIDIANotSupportedException e)
            {
                logger.Warn("setHbaoPlus - Caught NVIDIANotSupportedException: {0}", e);
                return;
            }

            if (NvidiaWorker.HasHbao || !Program.Client.nvBox.Checked || isHbao)
            {
                return;
            }

            Program.MyFactory.ExecNvSetter();
            isHbao = true;
        }