示例#1
0
        private void StartExclusiveFullscreenMode()
        {
            Size screenSize = Screen.FromControl(_frm).Bounds.Size;

            _frmFullscreenRenderer        = new frmFullscreenRenderer();
            _frmFullscreenRenderer.Shown += (object sender, EventArgs e) => {
                _renderer.Visible = false;
                SetScaleBasedOnScreenSize();
                EmuApi.SetFullscreenMode(true, _frmFullscreenRenderer.Handle, (UInt32)screenSize.Width, (UInt32)screenSize.Height);
            };
            _frmFullscreenRenderer.FormClosing += (object sender, FormClosingEventArgs e) => {
                EmuApi.SetFullscreenMode(false, _renderer.Handle, (UInt32)screenSize.Width, (UInt32)screenSize.Height);
                _frmFullscreenRenderer = null;
                _renderer.Visible      = true;
                _fullscreenMode        = false;
                frmMain_Resize(null, EventArgs.Empty);
            };

            Screen currentScreen = Screen.FromHandle(_frm.Handle);

            _frmFullscreenRenderer.StartPosition = FormStartPosition.Manual;
            _frmFullscreenRenderer.Top           = currentScreen.Bounds.Top;
            _frmFullscreenRenderer.Left          = currentScreen.Bounds.Left;
            _frmFullscreenRenderer.Show();
        }
示例#2
0
        private void StartExclusiveFullscreenMode()
        {
            Size   screenSize         = GetFullscreenResolution();
            Size   originalWindowSize = _frm.Size;
            double originalScale      = ConfigManager.Config.Video.VideoScale;

            _frm.Resize -= frmMain_Resize;

            _frmFullscreenRenderer        = new frmFullscreenRenderer();
            _frmFullscreenRenderer.Shown += (object sender, EventArgs e) => {
                _renderer.Visible = false;
                SetScaleBasedOnDimensions(screenSize);
                EmuApi.SetFullscreenMode(true, _frmFullscreenRenderer.Handle, (UInt32)screenSize.Width, (UInt32)screenSize.Height);
            };
            _frmFullscreenRenderer.FormClosing += (object sender, FormClosingEventArgs e) => {
                EmuApi.SetFullscreenMode(false, _renderer.Handle, (UInt32)screenSize.Width, (UInt32)screenSize.Height);
                _frm.Resize           += frmMain_Resize;
                _frmFullscreenRenderer = null;
                _renderer.Visible      = true;
                _fullscreenMode        = false;
                frmMain_Resize(null, EventArgs.Empty);

                SetScale(originalScale, false);
                _frm.Size = originalWindowSize;
            };

            Screen currentScreen = Screen.FromHandle(_frm.Handle);

            _frmFullscreenRenderer.StartPosition = FormStartPosition.Manual;
            _frmFullscreenRenderer.Top           = currentScreen.Bounds.Top;
            _frmFullscreenRenderer.Left          = currentScreen.Bounds.Left;
            _frmFullscreenRenderer.Size          = screenSize;
            _frmFullscreenRenderer.Show();
        }