Exemple #1
0
        public D3D11RenderingPane( Factory dxgiFactory, SlimDX.Direct3D11.Device d3D11Device, DeviceContext d3D11DeviceContext, D3D11HwndDescription d3D11HwndDescription )
        {
            mDxgiFactory = dxgiFactory;
            mD3D11Device = d3D11Device;
            mD3D11DeviceContext = d3D11DeviceContext;

            var swapChainDescription = new SwapChainDescription
                                       {
                                           BufferCount = 1,
                                           ModeDescription =
                                               new ModeDescription( d3D11HwndDescription.Width,
                                                                    d3D11HwndDescription.Height,
                                                                    new Rational( 60, 1 ),
                                                                    Format.R8G8B8A8_UNorm ),
                                           IsWindowed = true,
                                           OutputHandle = d3D11HwndDescription.Handle,
                                           SampleDescription = new SampleDescription( 1, 0 ),
                                           SwapEffect = SwapEffect.Discard,
                                           Usage = Usage.RenderTargetOutput
                                       };

            mSwapChain = new SwapChain( mDxgiFactory, mD3D11Device, swapChainDescription );
            mDxgiFactory.SetWindowAssociation( d3D11HwndDescription.Handle, WindowAssociationFlags.IgnoreAll );

            CreateD3D11Resources( d3D11HwndDescription.Width, d3D11HwndDescription.Height );

            PauseRendering = false;
        }
Exemple #2
0
        public D3D11RenderingPane(Factory dxgiFactory, SlimDX.Direct3D11.Device d3D11Device, DeviceContext d3D11DeviceContext, D3D11HwndDescription d3D11HwndDescription)
        {
            mDxgiFactory        = dxgiFactory;
            mD3D11Device        = d3D11Device;
            mD3D11DeviceContext = d3D11DeviceContext;

            var swapChainDescription = new SwapChainDescription
            {
                BufferCount     = 1,
                ModeDescription =
                    new ModeDescription(d3D11HwndDescription.Width,
                                        d3D11HwndDescription.Height,
                                        new Rational(60, 1),
                                        Format.R8G8B8A8_UNorm),
                IsWindowed        = true,
                OutputHandle      = d3D11HwndDescription.Handle,
                SampleDescription = new SampleDescription(1, 0),
                SwapEffect        = SwapEffect.Discard,
                Usage             = Usage.RenderTargetOutput
            };

            mSwapChain = new SwapChain(mDxgiFactory, mD3D11Device, swapChainDescription);
            mDxgiFactory.SetWindowAssociation(d3D11HwndDescription.Handle, WindowAssociationFlags.IgnoreAll);

            CreateD3D11Resources(d3D11HwndDescription.Width, d3D11HwndDescription.Height);

            PauseRendering = false;
        }