public SharpDX.DirectWrite.Factory DWriteFactory => this.bs_DWriteFactory;
public SharpDX.WIC.ImagingFactory2 WicImagingFactory2 => this.bs_WicImagingFactory2;
public SharpDX.Direct2D1.Device1 D2DDevice1 => this.bs_D2DDevice1;
+ public SharpDX.Direct2D1.DeviceContext1 D2DContext1 => this.bs_D2DContext1;
public void すべてのリソースを作成する( System.Drawing.Size バックバッファサイズ, IntPtr ウィンドウハンドル )
{
}
//-----------------
#endregion
+ #region " D2Dの既定のコンテキスト D2DContext1 を作成する。"
+ //-----------------
+ this.bs_D2DContext1 = new SharpDX.Direct2D1.DeviceContext1( this.D2DDevice1, SharpDX.Direct2D1.DeviceContextOptions.None );
+
+ // 現在のディスプレイDPI を取得し、D2DContext に設定する。
+ this.D2DContext1.DotsPerInch = this.D2DFactory2.DesktopDpi;
+ //-----------------
+ #endregion
}
this.サイズに依存するリソースを作成する();
FDK.Utilities.解放する( ref this.bs_DWriteFactory );
FDK.Utilities.解放する( ref this.bs_D2DFactory2 );
+ // D2D 関連
+ FDK.Utilities.解放する( ref this.bs_D2DContext1 );
+ FDK.Utilities.解放する( ref this.bs_D2DDevice1 );
+
+ // D3D 関連
var d3dDevice = (SharpDX.Direct3D11.Device) null;
using( var d3dLock = new FDK.同期.AutoD3DDeviceLock( this.DXGIDeviceManager, out d3dDevice ) )
{
- // デバイスステートをクリアする。
- d3dDevice.ImmediateContext?.ClearState();
-
- // スワップチェインをウインドウモードにする。
- this.bs_SwapChain?.SetFullscreenState( fullscreen: false, targetRef: null );
+ d3dDevice.ImmediateContext?.ClearState(); // デバイスステートをクリアする。
+ this.bs_SwapChain?.SetFullscreenState( fullscreen: false, targetRef: null ); // スワップチェインをウインドウモードにする。
this.サイズに依存するリソースを解放する();
- // 取得したインターフェイスの開放
FDK.Utilities.解放する( ref this.bs_D3DDepthStencilState );
FDK.Utilities.解放する( ref this.bs_SwapChain );
this.bs_DXGIDeviceManager?.ResetDevice( null );
private SharpDX.Direct3D11.Texture2D bs_D3DDepthStencil = null;
private SharpDX.Direct3D11.DepthStencilView bs_D3DDepthStencilView = null;
private SharpDX.Direct2D1.Device1 bs_D2DDevice1 = null;
+ private SharpDX.Direct2D1.DeviceContext1 bs_D2DContext1 = null;
//----------------
#endregion
}