// ReSharper restore InconsistentNaming static CompositionEngine() { _wicFactory = new SharpDX.WIC.ImagingFactory(); _dWriteFactory = new SharpDX.DirectWrite.Factory(); var d3DDevice = new SharpDX.Direct3D11.Device( DriverType.Hardware, DeviceCreationFlags.BgraSupport #if DEBUG | DeviceCreationFlags.Debug #endif , FeatureLevel.Level_11_1, FeatureLevel.Level_11_0, FeatureLevel.Level_10_1, FeatureLevel.Level_10_0, FeatureLevel.Level_9_3, FeatureLevel.Level_9_2, FeatureLevel.Level_9_1 ); var dxgiDevice = ComObject.As <SharpDX.DXGI.Device>(d3DDevice.NativePointer); //new SharpDX.DXGI.Device2(d3DDevice.NativePointer); var d2DDevice = new SharpDX.Direct2D1.Device(dxgiDevice); _d2DFactory = d2DDevice.Factory; _d2DDeviceContext = new SharpDX.Direct2D1.DeviceContext(d2DDevice, D2D.DeviceContextOptions.None); _d2DDeviceContext.DotsPerInch = new DrawingSizeF( Windows.Graphics.Display.DisplayProperties.LogicalDpi, Windows.Graphics.Display.DisplayProperties.LogicalDpi); }
// ReSharper restore InconsistentNaming static CompositionEngine() { _wicFactory = new SharpDX.WIC.ImagingFactory(); _dWriteFactory = new SharpDX.DirectWrite.Factory(); var d3DDevice = new SharpDX.Direct3D11.Device( DriverType.Hardware, DeviceCreationFlags.BgraSupport #if DEBUG | DeviceCreationFlags.Debug #endif , FeatureLevel.Level_11_1, FeatureLevel.Level_11_0, FeatureLevel.Level_10_1, FeatureLevel.Level_10_0, FeatureLevel.Level_9_3, FeatureLevel.Level_9_2, FeatureLevel.Level_9_1 ); var dxgiDevice = ComObject.As<SharpDX.DXGI.Device>(d3DDevice.NativePointer); //new SharpDX.DXGI.Device2(d3DDevice.NativePointer); var d2DDevice = new SharpDX.Direct2D1.Device(dxgiDevice); _d2DFactory = d2DDevice.Factory; _d2DDeviceContext = new SharpDX.Direct2D1.DeviceContext(d2DDevice, D2D.DeviceContextOptions.None); _d2DDeviceContext.DotsPerInch = new Size2F(LogicalDpi, LogicalDpi); }
public CompositionEngine() { _dxgiFactory = new SharpDX.DXGI.Factory1(); //_dxgiFactory.Adapters1[0].Description1. //_dxgiFactory = new SharpDX.DXGI.Factory(); //new _wicFactory = new SharpDX.WIC.ImagingFactory(); _d2DFactory = new SharpDX.Direct2D1.Factory(); _dWriteFactory = new SharpDX.DirectWrite.Factory(); }