Example #1
0
        /// <summary>
        /// Adds a request for the drawing to a render target to take place either at the end of this frame or at the
        /// beginning of the next frame.
        /// </summary>
        protected void RequestRenderTargetDraw(TargetRenderRequest request)
        {
            if (request.RenderTarget == null)
            {
                Debug.Error("Null render target, cannot request draw.");
                return;
            }

            renderTargetsToDraw.Add(request);
        }
Example #2
0
 /// <summary>
 /// Called whenever <see cref="RequestRenderTargetDraw(RenderTarget2D, bool)"/> is used to request a draw to a target.
 /// All the draw code within this method (such as spritebatch.Draw(texture, pos, color)) will write to the render target and not to the screen.
 /// Default implementation does nothing.
 /// </summary>
 /// <param name="target">The render target that is being drawn to.</param>
 /// <param name="spr">The spritebatch you should draw with.</param>
 /// <param name="isPreDraw">If true, this method is being called from before a draw call. If false, it is being called after a draw call.</param>
 protected virtual void DrawRenderTarget(TargetRenderRequest request, SpriteBatch spr)
 {
 }