2 using System.Collections.Generic;
3 using System.Diagnostics;
8 public class デバイスリソース : IDisposable
10 public SharpDX.Size2F 設計画面サイズdpx = new SharpDX.Size2F( 1920f, 1080f ); // 設計サイズ。
11 public SharpDX.Size2F 物理画面サイズpx = new SharpDX.Size2F( 0, 0 ); // (0, 0) は、サイズ依存リソース無効の印。
12 public IntPtr ウィンドウハンドル = IntPtr.Zero;
13 public float 視野角deg { get; set; } = 45f;
14 public SharpDX.Matrix ビュー変換行列
18 var カメラの位置 = new SharpDX.Vector3( 0f, 0f, ( -2f * this.dz( this.設計画面サイズdpx.Height, this.視野角deg ) ) );
19 var カメラの注視点 = new SharpDX.Vector3( 0f, 0f, 0f );
20 var カメラの上方向 = new SharpDX.Vector3( 0f, 1f, 0f );
21 var mat = SharpDX.Matrix.LookAtLH( カメラの位置, カメラの注視点, カメラの上方向 );
22 mat.Transpose(); // 転置
26 public SharpDX.Matrix 射影変換行列
30 float dz = this.dz( this.設計画面サイズdpx.Height, this.視野角deg );
31 var mat = SharpDX.Matrix.PerspectiveFovLH(
32 SharpDX.MathUtil.DegreesToRadians( 視野角deg ),
33 設計画面サイズdpx.Width / 設計画面サイズdpx.Height, // アスペクト比
36 mat.Transpose(); // 転置
40 public SharpDX.MediaFoundation.DXGIDeviceManager DXGIDeviceManager => ( this.bs_DXGIDeviceManager );
41 public SharpDX.DXGI.SwapChain1 SwapChain1 => ( this.bs_SwapChain1 );
42 public SharpDX.Direct3D11.RenderTargetView D3DRenderTargetView => ( this.bs_D3DRenderTargetView );
43 public SharpDX.Mathematics.Interop.RawViewportF[] D3DViewPort => ( this.bs_D3DViewPort );
44 public SharpDX.Direct3D11.Texture2D D3DDepthStencil => ( this.bs_D3DDepthStencil );
45 public SharpDX.Direct3D11.DepthStencilView D3DDepthStencilView => ( this.bs_D3DDepthStencilView );
46 public SharpDX.Direct3D11.DepthStencilState D3DDepthStencilState => ( this.bs_D3DDepthStencilState );
47 public SharpDX.Direct3D11.DeviceDebug D3DDeviceDebug => ( this.bs_D3DDeviceDebug );
48 public SharpDX.Direct2D1.Factory2 D2DFactory2 => ( this.bs_D2DFactory2 );
49 public SharpDX.DirectWrite.Factory DWriteFactory => ( this.bs_DWriteFactory );
50 public SharpDX.WIC.ImagingFactory2 WicImagingFactory2 => ( this.bs_WicImagingFactory2 );
51 public SharpDX.Direct2D1.Device1 D2DDevice1 => ( this.bs_D2DDevice1 );
52 public SharpDX.Direct2D1.DeviceContext1 D2DContext1 => ( this.bs_D2DContext1 );
53 public SharpDX.Direct2D1.Bitmap1 D2DRenderTargetBitmap => ( this.bs_D2DRenderTargetBitmap );
55 public float 拡大率DPXtoPX横方向 => ( this.物理画面サイズpx.Width / this.設計画面サイズdpx.Width );
56 public float 拡大率DPXtoPX縦方向 => ( this.物理画面サイズpx.Height / this.設計画面サイズdpx.Height );
57 public float 拡大率PXtoDPX横方向 => ( 1f / this.拡大率DPXtoPX横方向 );
58 public float 拡大率PXtoDPX縦方向 => ( 1f / this.拡大率DPXtoPX縦方向 );
59 public SharpDX.Matrix3x2 拡大行列DPXtoPX => SharpDX.Matrix3x2.Scaling( this.拡大率DPXtoPX横方向, this.拡大率DPXtoPX縦方向 );
60 public SharpDX.Matrix3x2 拡大行列PXtoDPX => SharpDX.Matrix3x2.Scaling( this.拡大率PXtoDPX横方向, this.拡大率PXtoDPX縦方向 );
62 public void すべてのリソースを作成する( System.Drawing.Size バックバッファサイズpx, IntPtr ウィンドウハンドル )
66 FDK.Log.BeginInfo( $"{FDK.Utilities.現在のメソッド名}" );
68 this.物理画面サイズpx = new SharpDX.Size2F( バックバッファサイズpx.Width, バックバッファサイズpx.Height );
69 this.ウィンドウハンドル = ウィンドウハンドル;
75 FDK.Log.EndInfo( $"{FDK.Utilities.現在のメソッド名}" );
78 protected void すべてのリソースを作成する()
82 FDK.Log.BeginInfo( $"{FDK.Utilities.現在のメソッド名}" );
84 // これらが呼び出し前に設定されていること。
85 Debug.Assert( ( 0f < this.物理画面サイズpx.Width ) && ( 0f < this.物理画面サイズpx.Height ) );
86 Debug.Assert( IntPtr.Zero != this.ウィンドウハンドル );
88 #region " D2DFactory2 を作成する。"
91 var デバッグレベル = SharpDX.Direct2D1.DebugLevel.None;
93 // プロジェクトがデバッグビルドに含まれている場合は、Direct2D デバッグレイヤーを SDK レイヤーを介して有効にする。
94 デバッグレベル = SharpDX.Direct2D1.DebugLevel.Information;
96 this.bs_D2DFactory2 = new SharpDX.Direct2D1.Factory2( SharpDX.Direct2D1.FactoryType.MultiThreaded, デバッグレベル );
100 #region " DWriteFactory を作成する。"
102 this.bs_DWriteFactory = new SharpDX.DirectWrite.Factory( SharpDX.DirectWrite.FactoryType.Shared );
105 #region " WicImagingFactory2 を作成する。"
107 this.bs_WicImagingFactory2 = new SharpDX.WIC.ImagingFactory2();
111 var d3dDevice = (SharpDX.Direct3D11.Device) null;
113 #region " DXGIDeviceManager を作成する。"
115 this.bs_DXGIDeviceManager = new SharpDX.MediaFoundation.DXGIDeviceManager();
118 #region " D3Dデバイスを作成する。"
121 var creationFlags = SharpDX.Direct3D11.DeviceCreationFlags.BgraSupport; // D2Dをサポートするなら BgraSupport フラグが必須。
123 // D3D11 Debugメッセージは、プロジェクトプロパティで「ネイティブコードのデバッグを有効にする」を ON にしないと表示されないので注意。
124 creationFlags |= SharpDX.Direct3D11.DeviceCreationFlags.Debug;
126 d3dDevice = new SharpDX.Direct3D11.Device(
127 SharpDX.Direct3D.DriverType.Hardware,
129 new SharpDX.Direct3D.FeatureLevel[] {
130 SharpDX.Direct3D.FeatureLevel.Level_11_1,
131 SharpDX.Direct3D.FeatureLevel.Level_11_0,
134 FDK.Log.Info( "D3Dデバイスを生成しました。" );
135 FDK.Log.Info( $"機能レベル: {d3dDevice.FeatureLevel.ToString()}" );
143 #region " スワップチェーンを作成する。"
145 using( var dxgiDevice = d3dDevice.QueryInterface<SharpDX.DXGI.Device>() )
146 using( var dxgiAdapter = dxgiDevice.Adapter )
147 using( var dxgiFactory2 = dxgiAdapter.GetParent<SharpDX.DXGI.Factory2>() )
149 var swapChainDesc1 = new SharpDX.DXGI.SwapChainDescription1() {
151 Width = (int) this.物理画面サイズpx.Width,
152 Height = (int) this.物理画面サイズpx.Height,
153 Format = SharpDX.DXGI.Format.B8G8R8A8_UNorm, // D2D をサポートするなら B8G8R8A8 を使う必要がある。
154 Scaling = SharpDX.DXGI.Scaling.Stretch,
155 SampleDescription = new SharpDX.DXGI.SampleDescription( 1, 0 ),
156 SwapEffect = SharpDX.DXGI.SwapEffect.FlipDiscard, // Windowsストアアプリはこれが必須。
157 Usage = SharpDX.DXGI.Usage.RenderTargetOutput,
158 Flags = SharpDX.DXGI.SwapChainFlags.None,// SharpDX.DXGI.SwapChainFlags.AllowModeSwitch, // ResizeTarget を使うなら必須
160 this.bs_SwapChain1 = new SharpDX.DXGI.SwapChain1(
164 ref swapChainDesc1 );
168 #region " デバイスからデバッグオブジェクトを取得する。"
170 this.bs_D3DDeviceDebug = d3dDevice.QueryInterfaceOrNull<SharpDX.Direct3D11.DeviceDebug>();
173 #region " D3DDevice が ID3D11VideoDevice を実装してないならエラー。(Win8以降のPCでは実装されているはず。) "
175 using( var videoDevice = d3dDevice.QueryInterfaceOrNull<SharpDX.Direct3D11.VideoDevice>() )
177 if( null == videoDevice )
178 throw new FDKException( "Direct3D11デバイスが、ID3D11VideoDevice をサポートしていません。" );
182 #region " マルチスレッドモードを ON に設定する。DXVAを使う場合は必須。"
184 using( var multithread = d3dDevice.QueryInterfaceOrNull<SharpDX.Direct3D.DeviceMultithread>() )
186 if( null == multithread )
187 throw new FDKException( "Direct3D11デバイスが、ID3D10Multithread をサポートしていません。" );
189 multithread.SetMultithreadProtected( true );
193 #region " DXGIデバイスマネージャに D3Dデバイスを登録する。"
195 this.DXGIDeviceManager.ResetDevice( d3dDevice );
198 #region " すべての Windows イベントを無視する。具体的には PrintScreen と Alt+Enter 。"
200 using( var factory = this.bs_SwapChain1.GetParent<SharpDX.DXGI.Factory>() )
202 factory.MakeWindowAssociation( ウィンドウハンドル, SharpDX.DXGI.WindowAssociationFlags.IgnoreAll );
208 this.サイズに依存するリソースを作成する();
212 FDK.Log.EndInfo( $"{FDK.Utilities.現在のメソッド名}" );
215 public void すべてのリソースを解放する()
219 FDK.Log.BeginInfo( $"{FDK.Utilities.現在のメソッド名}" );
222 this.bs_SwapChain1?.SetFullscreenState( fullscreen: false, targetRef: null ); // スワップチェインをウインドウモードにする。
223 this.サイズに依存するリソースを解放する();
225 FDK.Utilities.解放する( ref this.bs_SwapChain1 );
226 FDK.Utilities.解放する( ref this.bs_DXGIDeviceManager );
229 FDK.Utilities.解放する( ref this.bs_WicImagingFactory2 );
230 FDK.Utilities.解放する( ref this.bs_DWriteFactory );
231 FDK.Utilities.解放する( ref this.bs_D2DFactory2 );
233 this.bs_D3DDeviceDebug?.ReportLiveDeviceObjects( SharpDX.Direct3D11.ReportingLevel.Detail );
234 FDK.Utilities.解放する( ref this.bs_D3DDeviceDebug );
238 FDK.Log.EndInfo( $"{FDK.Utilities.現在のメソッド名}" );
241 public void Dispose()
243 this.すべてのリソースを解放する();
245 public void サイズに依存するリソースを作成する()
249 FDK.Log.BeginInfo( $"{FDK.Utilities.現在のメソッド名}" );
251 #region " スワップチェーンのサイズを変更する。"
253 Debug.Assert( null != this.SwapChain1 ); // スワップチェーンは(デバイスとともに)すでに生成されていること。
255 // ResizeTarget は、全画面モードにしたとき、モニタ画面の解像度も変更する。
256 //var mode = new SharpDX.DXGI.ModeDescription(
257 // width: (int) this.物理画面サイズpx.Width,
258 // height: (int) this.物理画面サイズpx.Height,
259 // refreshRate: new SharpDX.DXGI.Rational( 60000, 1001 ), // 多くのモニタは(60,1)じゃない;一致しないとFlipじゃなくBlitになるので注意(MSDN)。
260 // format: SharpDX.DXGI.Format.B8G8R8A8_UNorm );
261 //this.SwapChain.ResizeTarget( ref mode );
263 // ResizeBuffers は、全画面モードにしたとき、モニタの解像度を変更しない。
264 // ただし、swapChainFlags に AllowModeSwitch を指定すると変更される(ResizeTargetと同じ挙動になる)。
265 this.SwapChain1.ResizeBuffers(
267 width: (int) this.物理画面サイズpx.Width,
268 height: (int) this.物理画面サイズpx.Height,
269 newFormat: SharpDX.DXGI.Format.B8G8R8A8_UNorm,
270 swapChainFlags: SharpDX.DXGI.SwapChainFlags.None );
274 // バックバッファを使って、D3D / D2D 関連のリソースを作成する。
275 using( var backBuffer = SharpDX.Direct3D11.Texture2D.FromSwapChain<SharpDX.Direct3D11.Texture2D>( this.bs_SwapChain1, 0 ) )
277 var d3dDevice = (SharpDX.Direct3D11.Device) null;
278 using( var d3dLock = new FDK.同期.AutoD3DDeviceLock( this.DXGIDeviceManager, out d3dDevice ) )
282 #region " レンダーターゲットビューを作成する。"
284 this.bs_D3DRenderTargetView = new SharpDX.Direct3D11.RenderTargetView( d3dDevice, backBuffer );
287 #region " 深度ステンシルテクスチャを作成する。"
289 var descDepth = backBuffer.Description;
290 //descDepth.Width = backBuffer.Description.Width; → backBuffer に同じ
291 //descDepth.Height = backBuffer.Description.Height; → 同上
292 descDepth.MipLevels = 1; // ミップマップレベル数
293 descDepth.ArraySize = 1; // 配列サイズ
294 descDepth.Format = SharpDX.DXGI.Format.D32_Float; // フォーマット(深度のみ)
295 descDepth.Usage = SharpDX.Direct3D11.ResourceUsage.Default; // デフォルト使用法
296 descDepth.BindFlags = SharpDX.Direct3D11.BindFlags.DepthStencil; // 深度ステンシル
297 descDepth.CpuAccessFlags = SharpDX.Direct3D11.CpuAccessFlags.None; // CPUからはアクセスしない
298 descDepth.OptionFlags = SharpDX.Direct3D11.ResourceOptionFlags.None; // その他の設定なし
299 this.bs_D3DDepthStencil = new SharpDX.Direct3D11.Texture2D( d3dDevice, descDepth );
302 #region " 深度ステンシルビューを作成する。"
304 var descDSV = new SharpDX.Direct3D11.DepthStencilViewDescription() {
305 Format = descDepth.Format,
306 Dimension = SharpDX.Direct3D11.DepthStencilViewDimension.Texture2D,
307 Flags = SharpDX.Direct3D11.DepthStencilViewFlags.None,
308 Texture2D = new SharpDX.Direct3D11.DepthStencilViewDescription.Texture2DResource() {
312 this.bs_D3DDepthStencilView = new SharpDX.Direct3D11.DepthStencilView( d3dDevice, this.bs_D3DDepthStencil, descDSV );
315 #region " 深度ステンシルステートを作成する。"
317 var DepthSencil = new SharpDX.Direct3D11.DepthStencilStateDescription() {
318 IsDepthEnabled = true, // 深度テストあり
319 DepthWriteMask = SharpDX.Direct3D11.DepthWriteMask.All, // 書き込む
320 DepthComparison = SharpDX.Direct3D11.Comparison.Less, // 手前の物体を描画
321 IsStencilEnabled = false, // ステンシルテストなし。
322 StencilReadMask = 0, // ステンシル読み込みマスク。
323 StencilWriteMask = 0, // ステンシル書き込みマスク。
325 // 面が表を向いている場合のステンシル・テストの設定
326 FrontFace = new SharpDX.Direct3D11.DepthStencilOperationDescription() {
327 FailOperation = SharpDX.Direct3D11.StencilOperation.Keep, // 維持
328 DepthFailOperation = SharpDX.Direct3D11.StencilOperation.Keep, // 維持
329 PassOperation = SharpDX.Direct3D11.StencilOperation.Keep, // 維持
330 Comparison = SharpDX.Direct3D11.Comparison.Never, // 常に失敗
333 // 面が裏を向いている場合のステンシル・テストの設定
334 BackFace = new SharpDX.Direct3D11.DepthStencilOperationDescription() {
335 FailOperation = SharpDX.Direct3D11.StencilOperation.Keep, // 維持
336 DepthFailOperation = SharpDX.Direct3D11.StencilOperation.Keep, // 維持
337 PassOperation = SharpDX.Direct3D11.StencilOperation.Keep, // 維持
338 Comparison = SharpDX.Direct3D11.Comparison.Always, // 常に成功
341 this.bs_D3DDepthStencilState = new SharpDX.Direct3D11.DepthStencilState( d3dDevice, DepthSencil );
344 #region " ビューポートを作成する。"
346 this.bs_D3DViewPort[ 0 ] = new SharpDX.Mathematics.Interop.RawViewportF() {
349 Width = (float) backBuffer.Description.Width, // 物理画面単位[px]
350 Height = (float) backBuffer.Description.Height, // 物理画面単位[px]
356 #region " 全テクスチャで共有するリソースを作成する。"
358 FDK.メディア.テクスチャ.全インスタンスで共有するリソースを作成する( this );
363 using( var backsurface = SharpDX.DXGI.Surface.FromSwapChain( this.bs_SwapChain1, 0 ) )
365 #region " D2DDevice を作成する。"
367 using( var dxgiDevice = d3dDevice.QueryInterfaceOrNull<SharpDX.DXGI.Device>() )
369 if( null == dxgiDevice )
370 throw new FDKException( "Direct3D11デバイスが、IDXGIDevice3 をサポートしていません。" );
372 this.bs_D2DDevice1 = new SharpDX.Direct2D1.Device1( this.D2DFactory2, dxgiDevice );
376 #region " D2Dの既定のデバイスコンテキストを作成する。"
378 this.bs_D2DContext1 = new SharpDX.Direct2D1.DeviceContext1( this.D2DDevice1, SharpDX.Direct2D1.DeviceContextOptions.None );
380 // 現在のディスプレイDPI を取得し、D2DContext に設定する。
381 //this.D2DContext1.DotsPerInch = this.D2DFactory2.DesktopDpi;
382 this.D2DContext1.DotsPerInch = new SharpDX.Size2F( 96f, 96f );
385 #region " D2Dの既定のレンダーターゲットビットマップを作成する。"
387 var dpi = this.D2DContext1.DotsPerInch;
389 // DXGIスワップチェーンのバックバッファとデータを共有するD2Dターゲットビットマップを作成する。ビューではなく共有リソース。
390 this.bs_D2DRenderTargetBitmap = new SharpDX.Direct2D1.Bitmap1(
391 this.D2DContext1, // このコンテキストを通じて、
392 backsurface, // バックバッファとデータを共有する。
393 new SharpDX.Direct2D1.BitmapProperties1(
394 new SharpDX.Direct2D1.PixelFormat( backsurface.Description.Format, SharpDX.Direct2D1.AlphaMode.Premultiplied ),
397 SharpDX.Direct2D1.BitmapOptions.Target | SharpDX.Direct2D1.BitmapOptions.CannotDraw ) );
399 // ここでもうD2Dのレンダーターゲットとして登録しておく。
400 this.D2DContext1.Target = this.bs_D2DRenderTargetBitmap;
403 #region " テキストのアンチエイリアシングを設定する。"
405 // Grayscale が、すべての Windows ストアアプリで推奨される。らしい。
406 this.D2DContext1.TextAntialiasMode = SharpDX.Direct2D1.TextAntialiasMode.Grayscale;
415 FDK.Log.EndInfo( $"{FDK.Utilities.現在のメソッド名}" );
418 public void サイズに依存するリソースを解放する()
422 FDK.Log.BeginInfo( $"{FDK.Utilities.現在のメソッド名}" );
425 if( null != this.bs_D2DContext1 )
426 this.bs_D2DContext1.Target = null;
427 FDK.Utilities.解放する( ref this.bs_D2DRenderTargetBitmap );
428 FDK.Utilities.解放する( ref this.bs_D2DContext1 );
429 FDK.Utilities.解放する( ref this.bs_D2DDevice1 );
432 var d3dDevice = (SharpDX.Direct3D11.Device) null;
433 using( var d3dLock = new FDK.同期.AutoD3DDeviceLock( this.DXGIDeviceManager, out d3dDevice ) )
435 using( var d3dContext = d3dDevice.ImmediateContext )
437 d3dContext.ClearState();
438 d3dContext.OutputMerger.ResetTargets();
440 FDK.メディア.テクスチャ.全インスタンスで共有するリソースを解放する();
442 FDK.Utilities.解放する( ref this.bs_D3DDepthStencilState );
443 FDK.Utilities.解放する( ref this.bs_D3DDepthStencilView );
444 FDK.Utilities.解放する( ref this.bs_D3DDepthStencil );
445 FDK.Utilities.解放する( ref this.bs_D3DRenderTargetView );
446 //FDK.Utilities.解放する( ref this.bs_SwapChain ); → スワップチェーンは解放しない(これの生成・解放はデバイスとセットで行う)。
448 // (0,0)は、サイズ依存リソース無効の印。
449 this.物理画面サイズpx = new SharpDX.Size2F( 0, 0 );
454 FDK.Log.EndInfo( $"{FDK.Utilities.現在のメソッド名}" );
457 public void D3Dデバイスが消失していれば再構築する( out bool 異常状態なのでアプリを終了せよ )
459 異常状態なのでアプリを終了せよ = false;
462 var d3dDevice = (SharpDX.Direct3D11.Device) null;
463 using( var d3dLock = new FDK.同期.AutoD3DDeviceLock( this.DXGIDeviceManager, out d3dDevice ) )
466 削除理由 = d3dDevice.DeviceRemovedReason;
470 return; // デバイスは消失していない。
473 new { Code = SharpDX.DXGI.ResultCode.DeviceHung.Code, Info = SharpDX.DXGI.ResultCode.DeviceHung.ApiCode, Rebuild = true },
474 new { Code = SharpDX.DXGI.ResultCode.DeviceReset.Code, Info = SharpDX.DXGI.ResultCode.DeviceReset.ApiCode, Rebuild = true },
475 new { Code = SharpDX.DXGI.ResultCode.DeviceRemoved.Code, Info = SharpDX.DXGI.ResultCode.DeviceRemoved.ApiCode, Rebuild = false },
476 new { Code = SharpDX.DXGI.ResultCode.DriverInternalError.Code, Info = SharpDX.DXGI.ResultCode.DriverInternalError.ApiCode, Rebuild = false },
477 new { Code = SharpDX.DXGI.ResultCode.InvalidCall.Code, Info = SharpDX.DXGI.ResultCode.InvalidCall.ApiCode, Rebuild = false },
478 }.First( ( エラー ) => エラー.Code == 削除理由.Code ); // 見つからないなら System.InvalidOperationException 。
480 Trace.WriteLine( $"D3Dデバイスが消失しました: {エラー詳細.Info}" );
484 this.すべてのリソースを解放する();
485 this.すべてのリソースを作成する();
489 異常状態なのでアプリを終了せよ = true;
492 public void D2DContextの設定をリセットする( SharpDX.Direct2D1.DeviceContext1 context1 )
494 context1.Transform = SharpDX.Matrix3x2.Identity;
495 context1.PrimitiveBlend = SharpDX.Direct2D1.PrimitiveBlend.SourceOver;
498 private float dz( float 高さdpx, float 視野角deg )
500 return (float) ( 高さdpx / ( 4.0 * Math.Tan( SharpDX.MathUtil.DegreesToRadians( 視野角deg / 2.0f ) ) ) );
505 private SharpDX.Direct2D1.Factory2 bs_D2DFactory2 = null;
506 private SharpDX.DirectWrite.Factory bs_DWriteFactory = null;
507 private SharpDX.WIC.ImagingFactory2 bs_WicImagingFactory2 = null;
508 private SharpDX.MediaFoundation.DXGIDeviceManager bs_DXGIDeviceManager = null;
509 private SharpDX.DXGI.SwapChain1 bs_SwapChain1 = null;
510 private SharpDX.Mathematics.Interop.RawViewportF[] bs_D3DViewPort = new SharpDX.Mathematics.Interop.RawViewportF[ 1 ];
511 private SharpDX.Direct3D11.DepthStencilState bs_D3DDepthStencilState = null;
512 private SharpDX.Direct3D11.RenderTargetView bs_D3DRenderTargetView = null;
513 private SharpDX.Direct3D11.Texture2D bs_D3DDepthStencil = null;
514 private SharpDX.Direct3D11.DepthStencilView bs_D3DDepthStencilView = null;
515 private SharpDX.Direct3D11.DeviceDebug bs_D3DDeviceDebug = null;
516 private SharpDX.Direct2D1.Device1 bs_D2DDevice1 = null;
517 private SharpDX.Direct2D1.DeviceContext1 bs_D2DContext1 = null;
518 private SharpDX.Direct2D1.Bitmap1 bs_D2DRenderTargetBitmap = null;