Example #1
0
        public static void PushRenderTarget(RenderTarget2D renderTarget)
        {
            SpriteBatchSettings newSettings =
                new SpriteBatchSettings(SpriteSortMode.Deferred, BlendState.AlphaBlend, null);

            PushRenderTarget(renderTarget, newSettings);
        }
Example #2
0
 /// <summary>
 /// Pushes new settings into the renderer's internal stack and applies them.
 /// A call to <see cref="PushSettings(SpriteBatchSettings)"/> should always
 /// be followed by <see cref="PopSettings"/> once drawing with the new settings is done.
 /// </summary>
 /// <param name="settings">The sprite batch settings.</param>
 public static void PushSettings(SpriteBatchSettings settings)
 {
     EndDraw();
     PushSettingsInternal();
     CurrentSettings = settings;
     BeginDrawInternal(CurrentSettings);
 }
Example #3
0
        public static void PushRenderTarget(RenderTarget2D renderTarget, SpriteBatchSettings newSettings)
        {
            Renderer.EndDraw();
            RenderContext context = new RenderContext(renderTarget, currentContext);

            currentContext = context;
            graphicsDevice.SetRenderTarget(renderTarget);
            Renderer.PushSettingsInternal();
            Renderer.CurrentSettings = newSettings;
            Renderer.BeginDraw();
        }
Example #4
0
 internal static void PopSettingsInternal()
 {
     CurrentSettings = settingStack.First.Value;
     settingStack.RemoveFirst();
 }
Example #5
0
        //BlendState blendState = new BlendState();
        //blendState.AlphaDestinationBlend = Blend.One;
        //blendState.ColorDestinationBlend = Blend.InverseSourceAlpha;
        //blendState.AlphaSourceBlend = Blend.SourceAlpha;
        //blendState.ColorSourceBlend = Blend.SourceAlpha;

        internal static void BeginDrawInternal(SpriteBatchSettings settings) =>
        BeginDrawInternal(settings.SpriteSortMode, settings.BlendState, settings.SamplerState);