Added sprite batch settings to maintain sprite batch begin settings and keep consistency and control over settings. Ninepatch uses this.
This commit is contained in:
61
RecrownedAthenaeum/Render/SpriteBatchSettings.cs
Normal file
61
RecrownedAthenaeum/Render/SpriteBatchSettings.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RecrownedAthenaeum.Render
|
||||
{
|
||||
/// <summary>
|
||||
/// The settings the sprite batch should use.
|
||||
/// </summary>
|
||||
public struct SpriteBatchSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines sprites sort mode.
|
||||
/// </summary>
|
||||
public SpriteSortMode spriteSortMode;
|
||||
|
||||
/// <summary>
|
||||
/// The blend state to use.
|
||||
/// </summary>
|
||||
public BlendState blendState;
|
||||
|
||||
/// <summary>
|
||||
/// Sampler state to use.
|
||||
/// </summary>
|
||||
public SamplerState samplerState;
|
||||
|
||||
/// <summary>
|
||||
/// The depth stencil state to use.
|
||||
/// </summary>
|
||||
public DepthStencilState depthStencilState;
|
||||
|
||||
/// <summary>
|
||||
/// The rasterizer state to use.
|
||||
/// </summary>
|
||||
public RasterizerState rasterizerState;
|
||||
|
||||
/// <summary>
|
||||
/// The effect to use.
|
||||
/// </summary>
|
||||
public Effect effect;
|
||||
|
||||
/// <summary>
|
||||
/// The transformation matrix to use.
|
||||
/// </summary>
|
||||
public Matrix transformMatrix;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Begins the given sprite batch with the current set of settings.
|
||||
/// </summary>
|
||||
/// <param name="spriteBatch">Begins the spritebatch with the given settings.</param>
|
||||
public void BeginSpriteBatch(SpriteBatch spriteBatch)
|
||||
{
|
||||
spriteBatch.Begin(spriteSortMode, blendState, samplerState, depthStencilState, rasterizerState, effect, transformMatrix);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user