A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

31 lines
1.2 KiB

// -----------------------------------------------------------------------
// <copyright file="Direct2D1Initialize.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Direct2D1
{
using Perspex.Direct2D1.Media;
using Perspex.Media;
using Perspex.Platform;
using Splat;
public static class Direct2D1Platform
{
public static void Initialize()
{
SharpDX.Direct2D1.Factory d2d1Factory = new SharpDX.Direct2D1.Factory();
SharpDX.DirectWrite.Factory dwFactory = new SharpDX.DirectWrite.Factory();
TextService textService = new TextService(dwFactory);
var locator = Locator.CurrentMutable;
locator.Register(() => d2d1Factory, typeof(SharpDX.Direct2D1.Factory));
locator.Register(() => dwFactory, typeof(SharpDX.DirectWrite.Factory));
locator.Register(() => textService, typeof(ITextService));
locator.Register(() => new Renderer(), typeof(IRenderer));
locator.Register(() => new StreamGeometryImpl(), typeof(IStreamGeometryImpl));
}
}
}