Move `DispMethodEnum` to `Bizware.BizwareGL`
This commit is contained in:
parent
00d19aa550
commit
6ea714ac31
|
@ -0,0 +1,9 @@
|
||||||
|
namespace BizHawk.Bizware.BizwareGL
|
||||||
|
{
|
||||||
|
public enum EDispMethod
|
||||||
|
{
|
||||||
|
OpenGL = 0,
|
||||||
|
GdiPlus = 1,
|
||||||
|
SlimDX9 = 2,
|
||||||
|
}
|
||||||
|
}
|
|
@ -14,6 +14,9 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IGL : IDisposable
|
public interface IGL : IDisposable
|
||||||
{
|
{
|
||||||
|
/// <remarks>HACK</remarks>
|
||||||
|
EDispMethod DispMethodEnum { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clears the specified buffer parts
|
/// Clears the specified buffer parts
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -10,6 +10,8 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
{
|
{
|
||||||
public class IGL_GdiPlus : IGL
|
public class IGL_GdiPlus : IGL
|
||||||
{
|
{
|
||||||
|
public EDispMethod DispMethodEnum => EDispMethod.GdiPlus;
|
||||||
|
|
||||||
// rendering state
|
// rendering state
|
||||||
private RenderTarget _currRenderTarget;
|
private RenderTarget _currRenderTarget;
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,8 @@ namespace BizHawk.Bizware.DirectX
|
||||||
{
|
{
|
||||||
public sealed class IGL_SlimDX9 : IGL
|
public sealed class IGL_SlimDX9 : IGL
|
||||||
{
|
{
|
||||||
|
public EDispMethod DispMethodEnum => EDispMethod.SlimDX9;
|
||||||
|
|
||||||
private const int D3DERR_DEVICELOST = -2005530520;
|
private const int D3DERR_DEVICELOST = -2005530520;
|
||||||
private const int D3DERR_DEVICENOTRESET = -2005530519;
|
private const int D3DERR_DEVICENOTRESET = -2005530519;
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,8 @@ namespace BizHawk.Bizware.OpenTK3
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class IGL_TK : IGL
|
public class IGL_TK : IGL
|
||||||
{
|
{
|
||||||
|
public EDispMethod DispMethodEnum => EDispMethod.OpenGL;
|
||||||
|
|
||||||
//rendering state
|
//rendering state
|
||||||
private Pipeline _currPipeline;
|
private Pipeline _currPipeline;
|
||||||
private RenderTarget _currRenderTarget;
|
private RenderTarget _currRenderTarget;
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
|
using BizHawk.Bizware.BizwareGL;
|
||||||
using BizHawk.Common;
|
using BizHawk.Common;
|
||||||
using BizHawk.Common.PathExtensions;
|
using BizHawk.Common.PathExtensions;
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
|
|
|
@ -7,11 +7,6 @@
|
||||||
NLuaPlusKopiLua
|
NLuaPlusKopiLua
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum EDispMethod
|
|
||||||
{
|
|
||||||
OpenGL, GdiPlus, SlimDX9
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum ESoundOutputMethod
|
public enum ESoundOutputMethod
|
||||||
{
|
{
|
||||||
DirectSound, XAudio2, OpenAL, Dummy
|
DirectSound, XAudio2, OpenAL, Dummy
|
||||||
|
|
|
@ -33,7 +33,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
IGL gl,
|
IGL gl,
|
||||||
PresentationPanel presentationPanel,
|
PresentationPanel presentationPanel,
|
||||||
Func<bool> getIsSecondaryThrottlingDisabled)
|
Func<bool> getIsSecondaryThrottlingDisabled)
|
||||||
: base(config, emulator, inputManager, movieSession, gl.DispMethodEnum(), gl, gl.CreateRenderer())
|
: base(config, emulator, inputManager, movieSession, gl.DispMethodEnum, gl, gl.CreateRenderer())
|
||||||
{
|
{
|
||||||
_presentationPanel = presentationPanel;
|
_presentationPanel = presentationPanel;
|
||||||
_getIsSecondaryThrottlingDisabled = getIsSecondaryThrottlingDisabled;
|
_getIsSecondaryThrottlingDisabled = getIsSecondaryThrottlingDisabled;
|
||||||
|
|
|
@ -16,13 +16,5 @@ namespace BizHawk.Client.EmuHawk
|
||||||
IGL_TK => new GuiRenderer(gl),
|
IGL_TK => new GuiRenderer(gl),
|
||||||
_ => throw new NotSupportedException()
|
_ => throw new NotSupportedException()
|
||||||
};
|
};
|
||||||
|
|
||||||
public static EDispMethod DispMethodEnum(this IGL gl) => gl switch
|
|
||||||
{
|
|
||||||
IGL_GdiPlus => EDispMethod.GdiPlus,
|
|
||||||
IGL_SlimDX9 => EDispMethod.SlimDX9,
|
|
||||||
IGL_TK => EDispMethod.OpenGL,
|
|
||||||
_ => throw new ArgumentException("unknown GL impl", nameof(gl))
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue