Пример #1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            tick += (float)gameTime.ElapsedGameTime.TotalSeconds;

            graphics.GraphicsDevice.SetRenderTarget(0, mainSurface);
            GraphicsDevice.Clear(Color.Black);

            // componets draw here
            //=================================
            base.Draw(gameTime);

            Texture2D shipTexture = spriteManager.GetSprite("ship0");

            spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
            spriteBatch.Draw(shipTexture, new Rectangle(512, 100, 32, 32), Color.White);
            spriteBatch.End();


            graphics.GraphicsDevice.SetRenderTarget(0, null);


            //=================================
            // post drawing
            postEffectManager.Draw(gameTime);
            spriteBatch.Begin(SpriteBlendMode.None);

            PostProcessManager.DrawScreenRect(spriteBatch, postEffectManager.OutPutTexture);

            spriteBatch.End();
        }