FlatRedBall.Graphics.PostProcessing.Blur.DrawToCameraRenderTarget C# (CSharp) Method

DrawToCameraRenderTarget() private method

private DrawToCameraRenderTarget ( Camera camera, Microsoft.Xna.Framework.Graphics.Texture2D &texture, Color clearColor, Rectangle &sourceRectangle ) : void
camera Camera
texture Microsoft.Xna.Framework.Graphics.Texture2D
clearColor Color
sourceRectangle Microsoft.Xna.Framework.Rectangle
return void
        internal override void DrawToCameraRenderTarget(Camera camera,
                                        ref Texture2D texture,
                                        Color clearColor,
                                        ref Rectangle sourceRectangle)
        {

            // Set the effect parameters
            SetEffectParameters(camera);

            #region Horizontal Blur

            // Set the effect technique
            mEffect.CurrentTechnique = mEffect.Techniques[mTechniqueHorizontal];

            // Draw the horizontal pass
            DrawToTexture(camera, ref mTexture, clearColor, ref texture, ref sourceRectangle);

            #endregion

            #region Vertical Blur

            // Set the effect technique
            mEffect.CurrentTechnique = mEffect.Techniques[mTechniqueVertical];

#if XNA4
            throw new NotImplementedException();
            // Unreachable code, but uncomment once the NotImplementedException is removed:
            //DrawToCurrentTarget(camera, ref mTexture, clearColor, ref sourceRectangle);

#else
            // Draw the vertical pass
            DrawToCurrentTarget(camera, ref mTexture, clearColor, ref sourceRectangle);
            camera.mRenderTargetTexture.SetOnDevice();

#endif

            #endregion
        }
        #endregion