public void InitializeDevice(IntPtr windowHandle) { D3Device = DirectXTools.CreateD3Device(); { RenderTarget = DirectXTools.CreateRenderTarget(Direct2DFactory, D3Device); _solidBrush = RenderTarget.CreateSolidColorBrush(Color4.Black); SwapChain = DirectXTools.CreateSwapChainForHwnd(D3Device, windowHandle); DirectXTools.CreateDeviceSwapChainBitmap(SwapChain, RenderTarget); Bitmaps.SetRenderTarget(RenderTarget); TextLayouts.SetRenderTarget(RenderTarget); } }
public void InitializeDeviceGdiCompatible(IntPtr windowHandle, int width, int height) { D3Device = DirectXTools.CreateD3Device(); { RenderTarget = DirectXTools.CreateRenderTarget(Direct2DFactory, D3Device); _solidBrush = RenderTarget.CreateSolidColorBrush(Color4.Black); SwapChain = DirectXTools.CreateSwapChainForHwnd(D3Device, windowHandle); //DirectXTools.CreateDeviceSwapChainBitmap(SwapChain, RenderTarget); DirectXTools.CreateDeviceContextCPUBitmap(RenderTarget, width, height); Bitmaps.SetRenderTarget(RenderTarget); TextLayouts.SetRenderTarget(RenderTarget); } }