BizHawk/BizHawk.Client.Common/Extensions.cs

24 lines
586 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)
return new GuiRenderer(gl);
if (gl is IGL_SlimDX9)
return new GuiRenderer(gl);
if (gl is IGL_GdiPlus)
return new GDIPlusGuiRenderer((IGL_GdiPlus)gl);
throw new NotSupportedException();
}
}
}