BizHawk/BizHawk.Client.Common/Extensions.cs

32 lines
626 B
C#
Raw Normal View History

2017-04-29 21:49:29 +00:00
using System;
using BizHawk.Bizware.BizwareGL;
using BizHawk.Bizware.BizwareGL.Drivers.GdiPlus;
using BizHawk.Bizware.BizwareGL.Drivers.OpenTK;
using BizHawk.Bizware.BizwareGL.Drivers.SlimDX;
namespace BizHawk.Client.Common
{
public static class Extensions
{
public static IGuiRenderer CreateRenderer(this IGL gl)
{
if (gl is IGL_TK)
2017-05-09 12:21:38 +00:00
{
2017-04-29 21:49:29 +00:00
return new GuiRenderer(gl);
2017-05-09 12:21:38 +00:00
}
2017-04-29 21:49:29 +00:00
if (gl is IGL_SlimDX9)
2017-05-09 12:21:38 +00:00
{
2017-04-29 21:49:29 +00:00
return new GuiRenderer(gl);
2017-05-09 12:21:38 +00:00
}
2017-04-29 21:49:29 +00:00
if (gl is IGL_GdiPlus)
2017-05-09 12:21:38 +00:00
{
2017-04-29 21:49:29 +00:00
return new GDIPlusGuiRenderer((IGL_GdiPlus)gl);
2017-05-09 12:21:38 +00:00
}
2017-04-29 21:49:29 +00:00
throw new NotSupportedException();
}
}
}