use OSTailoredCode class to decide GDI vs GDIPlus renderering

This commit is contained in:
adelikat 2019-10-25 18:20:13 -05:00
parent 6395089a9c
commit 2e489763b9
1 changed files with 9 additions and 2 deletions

View File

@ -7,6 +7,7 @@ using System.Windows.Forms;
using BizHawk.Client.Common;
using BizHawk.Client.EmuHawk.CustomControls;
using BizHawk.Common;
namespace BizHawk.Client.EmuHawk
{
@ -66,8 +67,14 @@ namespace BizHawk.Client.EmuHawk
SetStyle(ControlStyles.Opaque, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
//_renderer = new GdiRenderer();
_renderer = new GdiPlusRenderer();
if (OSTailoredCode.CurrentOS == OSTailoredCode.DistinctOS.Windows)
{
_renderer = new GdiRenderer();
}
else
{
_renderer = new GdiPlusRenderer();
}
using (var g = CreateGraphics())
using (_renderer.LockGraphics(g, Width, Height))