Pass global IGL to DisplayConfig (and then to RetroShaderChain)

This commit is contained in:
YoshiRulz 2020-11-29 13:59:30 +10:00
parent b26aa2e893
commit a34dde7c4f
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
2 changed files with 9 additions and 3 deletions

View File

@ -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();

View File

@ -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;
}