From a34dde7c4f4b2f5c1999133ff6f48135fec745fd Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Sun, 29 Nov 2020 13:59:30 +1000 Subject: [PATCH] Pass global IGL to DisplayConfig (and then to RetroShaderChain) --- src/BizHawk.Client.EmuHawk/MainForm.Events.cs | 2 +- src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/MainForm.Events.cs b/src/BizHawk.Client.EmuHawk/MainForm.Events.cs index d2a2e4f3cb..5d755b39c7 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -2283,7 +2283,7 @@ namespace BizHawk.Client.EmuHawk private void DisplayConfigMenuItem_Click(object sender, EventArgs e) { - using var window = new DisplayConfig(Config); + using var window = new DisplayConfig(Config, GlobalWin.GL); if (window.ShowDialog().IsOk()) { DisplayManager.RefreshUserShader(); diff --git a/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs b/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs index c80378706f..fa5500031f 100644 --- a/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs @@ -1,6 +1,8 @@ using System; using System.IO; using System.Windows.Forms; + +using BizHawk.Bizware.BizwareGL; using BizHawk.Client.Common; using BizHawk.Client.Common.Filters; using BizHawk.Common; @@ -11,13 +13,17 @@ namespace BizHawk.Client.EmuHawk { private readonly Config _config; + private readonly IGL _gl; + private string _pathSelection; public bool NeedReset { get; set; } - public DisplayConfig(Config config) + public DisplayConfig(Config config, IGL gl) { _config = config; + _gl = gl; + InitializeComponent(); rbNone.Checked = _config.TargetDisplayFilter == 0; @@ -265,7 +271,7 @@ namespace BizHawk.Client.EmuHawk string errors = ""; try { - var filter = new RetroShaderChain(GlobalWin.GL, cgp, Path.GetDirectoryName(choice)); + var filter = new RetroShaderChain(_gl, cgp, Path.GetDirectoryName(choice)); ok = filter.Available; errors = filter.Errors; }