示例#1
0
        // ReSharper disable once CommentTypo
        /// <summary>
        ///     This API allows the user to create a mono or a stereo swap chain.
        ///     NOTE: NvAPI_D3D1x_CreateSwapChain is a wrapper of the method IDXGIFactory::CreateSwapChain which
        ///     additionally notifies the D3D driver of the mode in which the swap chain is to be
        ///     created.
        /// </summary>
        /// <param name="handle">
        ///     Stereo handle that corresponds to the device interface. The device that will write 2D images to
        ///     the swap chain.
        /// </param>
        /// <param name="dxgiSwapChainDescription">
        ///     A pointer to the swap-chain description (DXGI_SWAP_CHAIN_DESC). This parameter
        ///     cannot be NULL.
        /// </param>
        /// <param name="swapChainMode">The stereo mode fot the swap chain.</param>
        /// <returns>A pointer to the swap chain created.</returns>
        public static IntPtr D3D1XCreateSwapChain(
            StereoHandle handle,
            IntPtr dxgiSwapChainDescription,
            StereoSwapChainMode swapChainMode)
        {
            var status = DelegateFactory.GetDelegate <Delegates.Stereo.NvAPI_D3D1x_CreateSwapChain>()(
                handle,
                dxgiSwapChainDescription,
                out var dxgiSwapChain,
                swapChainMode
                );

            if (status != Status.Ok)
            {
                throw new NVIDIAApiException(status);
            }

            return(dxgiSwapChain);
        }
示例#2
0
        /// <summary>
        ///     This API allows the user to create a mono or a stereo swap chain.
        ///     NOTE: NvAPI_D3D9_CreateSwapChain is a wrapper of the method IDirect3DDevice9::CreateAdditionalSwapChain which
        ///     additionally notifies the D3D driver if the swap chain creation mode must be stereo or mono.
        /// </summary>
        /// <param name="handle">Stereo handle that corresponds to the device interface.</param>
        /// <param name="d3dPresentParameters">A pointer to the swap-chain description (DXGI). This parameter cannot be NULL.</param>
        /// <param name="swapChainMode">The stereo mode for the swap chain.</param>
        /// <returns>A pointer to the swap chain created.</returns>
        public static IntPtr D3D9CreateSwapChain(
            StereoHandle handle,
            // ReSharper disable once InconsistentNaming
            IntPtr d3dPresentParameters,
            StereoSwapChainMode swapChainMode)
        {
            var status = DelegateFactory.GetDelegate <Delegates.Stereo.NvAPI_D3D9_CreateSwapChain>()(
                handle,
                d3dPresentParameters,
                out var direct3DSwapChain9,
                swapChainMode
                );

            if (status != Status.Ok)
            {
                throw new NVIDIAApiException(status);
            }

            return(direct3DSwapChain9);
        }