public static void PushRenderTarget(RenderTarget2D renderTarget) { SpriteBatchSettings newSettings = new SpriteBatchSettings(SpriteSortMode.Deferred, BlendState.AlphaBlend, null); PushRenderTarget(renderTarget, newSettings); }
/// <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); }
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(); }
internal static void PopSettingsInternal() { CurrentSettings = settingStack.First.Value; settingStack.RemoveFirst(); }
//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);