Ejemplo n.º 1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.SetRenderTarget(_VirtualRenderTarget);
            GraphicsDevice.Clear(BackgroundColor);

            // The real drawing happens inside the screen manager component.
            base.Draw(gameTime);

            // Reset the device to the back buffer
            GraphicsDevice.SetRenderTarget(null);
            GraphicsDevice.Clear(BackgroundColor);

            _VirtualTexture2D = (Texture2D)_VirtualRenderTarget;

            _SpriteBatch.Begin();
            _SpriteBatch.Draw(_VirtualTexture2D, ResolutionManager.PhysicalFullscreen, Color.White);
            _SpriteBatch.End();

            // Apply device changes
            if (GameSettingsManager.ResolutionChangesToApply)
            {
                ResolutionManager.ApplyResolutionChanges();
                GameSettingsManager.ResolutionChangesToApply = false;
                _VirtualRenderTarget = new RenderTarget2D(GraphicsDevice, ResolutionManager.VirtualWidth, ResolutionManager.VIRTUAL_HEIGHT);

                ResetElapsedTime();
            }
        }