diff --git a/src/BizHawk.Client.EmuHawk/GraphicsImplementations/GLControlWrapper_GdiPlus.cs b/src/BizHawk.Client.EmuHawk/GraphicsImplementations/GLControlWrapper_GdiPlus.cs index eda17b9088..2264014677 100644 --- a/src/BizHawk.Client.EmuHawk/GraphicsImplementations/GLControlWrapper_GdiPlus.cs +++ b/src/BizHawk.Client.EmuHawk/GraphicsImplementations/GLControlWrapper_GdiPlus.cs @@ -23,7 +23,7 @@ namespace BizHawk.Client.EmuHawk /// /// the render target for rendering to this control /// - public IGL_GdiPlus.RenderTargetWrapper RenderTargetWrapper; + public RenderTargetWrapper RenderTargetWrapper; public void SetVsync(bool state) { diff --git a/src/BizHawk.Client.EmuHawk/GraphicsImplementations/IGL_GdiPlus.cs b/src/BizHawk.Client.EmuHawk/GraphicsImplementations/IGL_GdiPlus.cs index 1f05587cb8..8b2159e2fb 100644 --- a/src/BizHawk.Client.EmuHawk/GraphicsImplementations/IGL_GdiPlus.cs +++ b/src/BizHawk.Client.EmuHawk/GraphicsImplementations/IGL_GdiPlus.cs @@ -251,59 +251,6 @@ namespace BizHawk.Client.EmuHawk { } - public class RenderTargetWrapper - { - public RenderTargetWrapper(IGL_GdiPlus gdi) - { - Gdi = gdi; - } - - public void Dispose() - { - } - - private readonly IGL_GdiPlus Gdi; - - /// - /// the control associated with this render target (if any) - /// - public GLControlWrapper_GdiPlus Control; - - /// - /// the offscreen render target, if that's what this is representing - /// - public RenderTarget Target; - - public BufferedGraphics MyBufferedGraphics; - - public Graphics refGraphics; //?? hacky? - - public void CreateGraphics() - { - Rectangle r; - if (Control != null) - { - r = Control.ClientRectangle; - refGraphics = Control.CreateGraphics(); - } - else - { - var tw = Target.Texture2d.Opaque as GDIPTextureWrapper; - r = Target.Texture2d.Rectangle; - refGraphics = Graphics.FromImage(tw.SDBitmap); - } - - MyBufferedGraphics?.Dispose(); - MyBufferedGraphics = Gdi.MyBufferedGraphicsContext.Allocate(refGraphics, r); - //MyBufferedGraphics.Graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighSpeed; - - ////not sure about this stuff... - ////it will wreck alpha blending, for one thing - //MyBufferedGraphics.Graphics.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceCopy; - //MyBufferedGraphics.Graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighSpeed; - } - } - public void BeginScene() { } diff --git a/src/BizHawk.Client.EmuHawk/GraphicsImplementations/RenderTargetWrapper.cs b/src/BizHawk.Client.EmuHawk/GraphicsImplementations/RenderTargetWrapper.cs new file mode 100644 index 0000000000..13b0881948 --- /dev/null +++ b/src/BizHawk.Client.EmuHawk/GraphicsImplementations/RenderTargetWrapper.cs @@ -0,0 +1,59 @@ +using System.Drawing; + +using BizHawk.Bizware.BizwareGL; + +namespace BizHawk.Client.EmuHawk +{ + public class RenderTargetWrapper + { + public RenderTargetWrapper(IGL_GdiPlus gdi) + { + Gdi = gdi; + } + + public void Dispose() + { + } + + private readonly IGL_GdiPlus Gdi; + + /// + /// the control associated with this render target (if any) + /// + public GLControlWrapper_GdiPlus Control; + + /// + /// the offscreen render target, if that's what this is representing + /// + public RenderTarget Target; + + public BufferedGraphics MyBufferedGraphics; + + public Graphics refGraphics; //?? hacky? + + public void CreateGraphics() + { + Rectangle r; + if (Control != null) + { + r = Control.ClientRectangle; + refGraphics = Control.CreateGraphics(); + } + else + { + var tw = Target.Texture2d.Opaque as GDIPTextureWrapper; + r = Target.Texture2d.Rectangle; + refGraphics = Graphics.FromImage(tw.SDBitmap); + } + + MyBufferedGraphics?.Dispose(); + MyBufferedGraphics = Gdi.MyBufferedGraphicsContext.Allocate(refGraphics, r); +// MyBufferedGraphics.Graphics.PixelOffsetMode = PixelOffsetMode.HighSpeed; + + //not sure about this stuff... + //it will wreck alpha blending, for one thing +// MyBufferedGraphics.Graphics.CompositingMode = CompositingMode.SourceCopy; +// MyBufferedGraphics.Graphics.CompositingQuality = CompositingQuality.HighSpeed; + } + } +}