using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace RecrownedAthenaeum.Render { /// /// The settings the sprite batch should use. /// public struct SpriteBatchSettings { /// /// Defines sprites sort mode. /// public SpriteSortMode spriteSortMode; /// /// The blend state to use. /// public BlendState blendState; /// /// Sampler state to use. /// public SamplerState samplerState; /// /// The depth stencil state to use. /// public DepthStencilState depthStencilState; /// /// The rasterizer state to use. /// public RasterizerState rasterizerState; /// /// The effect to use. /// public Effect effect; /// /// The transformation matrix to use. /// public Matrix? transformMatrix; /// /// See for uses and defaults. /// /// /// /// /// /// /// /// public SpriteBatchSettings(SpriteSortMode spriteSortMode = SpriteSortMode.Deferred, BlendState blendState = null, SamplerState samplerState = null, DepthStencilState depthStencilState = null, RasterizerState rasterizerState = null, Effect effect = null, Matrix? transformMatrix = null) { this.spriteSortMode = spriteSortMode; this.blendState = blendState; this.samplerState = samplerState; this.depthStencilState = depthStencilState; this.rasterizerState = rasterizerState; this.effect = effect; this.transformMatrix = transformMatrix; } /// /// Begins the given sprite batch with the current set of settings. /// /// Begins the spritebatch with the given settings. public void BeginSpriteBatch(SpriteBatch spriteBatch) { spriteBatch.Begin(spriteSortMode, blendState, samplerState, depthStencilState, rasterizerState, effect, transformMatrix); } } }