Beispiel #1
0
        protected override void Draw(GameTime gameTime)
        {
            _renderTargetBinding = GraphicsDevice.GetRenderTargets();
            GraphicsDevice.SetRenderTarget(_worldRenderTarget);

            GraphicsDevice.Clear(new Color(00, 170, 170));

            _spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend);

            if (RenderEvent != null)
            {
                RenderEvent(this, new RenderData(_spriteBatch));
            }

            _spriteBatch.End();

            _worldTexture = _worldRenderTarget;
            _worldTexture = _shaders.Draw(_spriteBatch, _worldTexture);

            GraphicsDevice.SetRenderTargets(_renderTargetBinding);

            _spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend);

            _spriteBatch.Draw(_worldTexture, Vector2.Zero, Color.White);
            _hud.Draw(_spriteBatch);

            _spriteBatch.End();

            base.Draw(gameTime);
        }