示例#1
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.BlueViolet);
            CurrentGameState.Render(gameTime);

            Graphics.GraphicsDevice.SetRenderTarget(null);
            GraphicsDevice.Clear(Color.Black);
            SpriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend,
                              SamplerState.LinearClamp, DepthStencilState.Default,
                              RasterizerState.CullNone);
            SpriteBatch.Draw(renderTarget, new Rectangle(0, 0, Consts.WindowWidth, Consts.WindowHeight), Color.White);
            SpriteBatch.End();
            Graphics.GraphicsDevice.SetRenderTarget(renderTarget);

            base.Draw(gameTime);
        }