[Bug] Full-screen mode with dual screen

View previous topic View next topic Go down

[Bug] Full-screen mode with dual screen

Post by S33m3 on Thu Apr 28, 2011 3:16 am

When I go in full screen on duel monitor system, it does like if my behind windows are moved appart (difficult to explains).

I had the same problem with slimDX.

Here is what I do to go in fullscreen with my engine - with the "resizing code also" (don't have this problem in my engine) :

isFullScreen Property
Code:

        public bool isFullScreen
        {
            get
            {
                return !_swapChain.Description.IsWindowed;
            }
            set
            {
                if (value != !_swapChain.Description.IsWindowed)
                {
                    _swapChain.SetFullScreenState(value, null);
                    WindowSizeChanged();
                }
            }
        }

WindowSizeChanged();
Code:
        private void WindowSizeChanged()
        {
            _renderTarget.Dispose();

            //Reisze backBuffer
            _swapChain.ResizeBuffers(1, _renderForm.ClientSize.Width, _renderForm.ClientSize.Height, _swapChain.Description.ModeDescription.Format, _swapChain.Description.Flags);

            //Resize renderTarget based on the new backbuffer size
            using (var backBuffer = Resource.FromSwapChain<Texture2D>(_swapChain, 0))
            {
                _renderTarget = new RenderTargetView(_graphicsDevice, backBuffer);
            }

            //Resize the view port
            _viewPort = new Viewport(0, 0, _renderForm.ClientSize.Width, _renderForm.ClientSize.Height);

            //Resize the stencilbuffer
            CreateDepthStencil();

            _graphicsDevice.OutputMerger.SetTargets(_depthStencil, _renderTarget);
            _graphicsDevice.Rasterizer.SetViewports(_viewPort);

            if (ViewPort_Updated != null) ViewPort_Updated(_viewPort); //<== Raise an event in the camera class to update the viewport

        }




S33m3

Posts : 54
Join date : 2011-03-23

View user profile

Back to top Go down

Re: [Bug] Full-screen mode with dual screen

Post by Blademaster on Thu Apr 28, 2011 7:46 am

Can you post a picture or screen capture of the bug?
avatar
Blademaster

Posts : 4
Join date : 2011-04-27
Age : 22
Location : On the moon

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum