protected override SharpDX.DXGI.SwapChain1 CreateSwapChain(SharpDX.DXGI.Factory2 factory, SharpDX.Direct3D11.Device1 device, SharpDX.DXGI.SwapChainDescription1 desc) { // Creates the swap chain for XAML composition var swapChain = factory.CreateSwapChainForComposition(device, ref desc, null); // Associate the SwapChainBackgroundPanel with the swap chain nativePanel.SwapChain = swapChain; // Returns the new swap chain return(swapChain); }
/// <summary> /// Creates a swapchain for DirectComposition API or WinRT XAML framework. This is applicable only for WinRT platform. /// </summary> /// <param name="factory">The DXGI Factory used to create the swapchain.</param> /// <param name="device">The associated device instance.</param> /// <param name="description">The swap chain description.</param> /// <param name="restrictToOutput">The output to which this swap chain should be restricted. Default is null, meaning that there is no restriction.</param> public SwapChain1(Factory2 factory, ComObject device, ref SwapChainDescription1 description, Output restrictToOutput = null) : base(IntPtr.Zero) { factory.CreateSwapChainForComposition(device, ref description, restrictToOutput, this); }