protected override SharpDX.DXGI.SwapChain1 CreateSwapChain(SharpDX.DXGI.Factory2 factory, SharpDX.Direct3D11.Device1 device, SharpDX.DXGI.SwapChainDescription1 desc) { // Creates a SwapChain from a CoreWindow pointer SwapChainFullScreenDescription scFullScreenDesc = new SwapChainFullScreenDescription() { Windowed = deviceManager.Settings.IsWindowed, RefreshRate = new Rational(120, 1) }; #if DIRECTX11_1 return(new SwapChain1(factory, device, form.Handle, ref desc)); #else return(factory.CreateSwapChainForHwnd(device, form.Handle, ref desc, scFullScreenDesc, null)); #endif }
/// <summary> /// Creates a swapchain associated to the specified HWND. This is applicable only for Desktop platform. /// </summary> /// <param name="factory">The DXGI Factory used to create the swapchain.</param> /// <param name="device">The associated device instance.</param> /// <param name="hwnd">The HWND of the window to which this swapchain is associated.</param> /// <param name="description">The swap chain description.</param> /// <param name="fullScreenDescription">The fullscreen description of the swap chain. Default is null.</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, IntPtr hwnd, ref SwapChainDescription1 description, SwapChainFullScreenDescription?fullScreenDescription = null, Output restrictToOutput = null) : base(IntPtr.Zero) { factory.CreateSwapChainForHwnd(device, hwnd, ref description, fullScreenDescription, restrictToOutput, this); }
/// <summary> /// Creates a swapchain associated to the specified HWND. This is applicable only for Desktop platform. /// </summary> /// <param name="factory">The DXGI Factory used to create the swapchain.</param> /// <param name="device">The associated device instance.</param> /// <param name="hwnd">The HWND of the window to which this swapchain is associated.</param> /// <param name="description">The swap chain description.</param> /// <param name="fullScreenDescription">The fullscreen description of the swap chain. Default is null.</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, IntPtr hwnd, ref SwapChainDescription1 description, SwapChainFullScreenDescription? fullScreenDescription = null, Output restrictToOutput = null) : base(IntPtr.Zero) { factory.CreateSwapChainForHwnd(device, hwnd, ref description, fullScreenDescription, restrictToOutput, this); }