Blokworld
Would you like to react to this message? Create an account in a few clicks or log in to continue.

[Bug] Full-screen mode with dual screen

2 posters

Go down

[Bug] Full-screen mode with dual screen Empty [Bug] Full-screen mode with dual screen

Post by S33m3 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

Back to top Go down

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

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

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

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

Back to top Go down

Back to top

- Similar topics

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