Ejemplo n.º 1
0
        void Draw(EffectTechnique technique, Texture2D source, RenderTarget2D destination)
        {
            effect.CurrentTechnique = technique;

            var samplerState = destination.GetPreferredSamplerState();

            graphicsDevice.SetRenderTarget(destination);
            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Opaque, samplerState, null, null, effect);
            spriteBatch.Draw(source, destination.Bounds, Color.White);
            spriteBatch.End();
            graphicsDevice.SetRenderTarget(null);
        }