Example #1
0
        private void PrerenderSourceAndTargetAndMakeTransition(Screen oldScreen, Screen currentScreen)
        {
            _executingScreenTransition = true;
            var currentRenderTarget = Game.GraphicsDevice.GetRenderTargets();

            Game.GraphicsDevice.SetRenderTarget(_sourceRenderTarget);
            oldScreen.OnDraw(new GameTime());

            Game.GraphicsDevice.SetRenderTarget(_targetRenderTarget);
            currentScreen.OnUpdate(new GameTime(TimeSpan.Zero, TimeSpan.FromSeconds(1.0/60.0d)));
            currentScreen.OnDraw(new GameTime());

            Game.GraphicsDevice.SetRenderTargets(currentRenderTarget);
            _currentTransition.StartTransition(_sourceRenderTarget, _targetRenderTarget);
        }