Move `SimpleGDIPDisplayManager` to `BizHawk.Client.Common`

This commit is contained in:
YoshiRulz 2024-07-03 22:49:51 +10:00
parent db8454a0ff
commit c188feb50c
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
2 changed files with 45 additions and 35 deletions

View File

@ -0,0 +1,45 @@
#nullable enable
using System;
using System.Drawing;
using BizHawk.Bizware.Graphics;
using BizHawk.Emulation.Common;
namespace BizHawk.Client.Common
{
public sealed class SimpleGDIPDisplayManager : DisplayManagerBase
{
private SimpleGDIPDisplayManager(Config config, IEmulator emuCore, IGL_GDIPlus glImpl)
: base(
config,
emuCore,
inputManager: null,
movieSession: null,
EDispMethod.GdiPlus,
glImpl,
new GDIPlusGuiRenderer(glImpl))
{}
public SimpleGDIPDisplayManager(Config config, IEmulator emuCore, Func<(int Width, int Height)> getVirtualSize)
: this(config, emuCore, new IGL_GDIPlus()) {}
protected override void ActivateGraphicsControlContext() {}
public override void ActivateOpenGLContext() {}
protected override int GetGraphicsControlDpi()
=> DisplayManagerBase.DEFAULT_DPI;
protected override Size GetGraphicsControlSize()
=> throw new NotImplementedException();
public override Size GetPanelNativeSize()
=> throw new NotImplementedException();
protected override Point GraphicsControlPointToClient(Point p)
=> throw new NotImplementedException();
protected override void SwapBuffersOfGraphicsControl() {}
}
}

View File

@ -78,41 +78,6 @@ namespace BizHawk.Tests.Testroms.GB
=> throw new NotImplementedException(); // only used by Encore
}
public sealed class SimpleGDIPDisplayManager : DisplayManagerBase
{
private SimpleGDIPDisplayManager(Config config, IEmulator emuCore, IGL_GDIPlus glImpl)
: base(
config,
emuCore,
inputManager: null,
movieSession: null,
EDispMethod.GdiPlus,
glImpl,
new GDIPlusGuiRenderer(glImpl))
{}
public SimpleGDIPDisplayManager(Config config, IEmulator emuCore, Func<(int Width, int Height)> getVirtualSize)
: this(config, emuCore, new IGL_GDIPlus()) {}
protected override void ActivateGraphicsControlContext() {}
public override void ActivateOpenGLContext() {}
protected override int GetGraphicsControlDpi()
=> DisplayManagerBase.DEFAULT_DPI;
protected override Size GetGraphicsControlSize()
=> throw new NotImplementedException();
public override Size GetPanelNativeSize()
=> throw new NotImplementedException();
protected override Point GraphicsControlPointToClient(Point p)
=> throw new NotImplementedException();
protected override void SwapBuffersOfGraphicsControl() {}
}
private static int _totalFrames = 0;
private static readonly object _totalFramesMutex = new();