refactoring; removed configuration setup; added consistent sprite batch; got rid of sprite batch settings; implemented newer setup;
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
|
||||
namespace RecrownedAthenaeum.Camera
|
||||
{
|
||||
/// <summary>
|
||||
/// A generic 3D camera.
|
||||
/// A generic camera. Functions in 3D.
|
||||
/// </summary>
|
||||
public class Camera3D
|
||||
public class BasicCamera
|
||||
{
|
||||
/// <summary>
|
||||
/// The scale for the world.
|
||||
@@ -24,7 +25,7 @@ namespace RecrownedAthenaeum.Camera
|
||||
public Vector3 lookAt;
|
||||
|
||||
/// <summary>
|
||||
/// The direction up is for the 3D camera.
|
||||
/// The direction up is for the camera.
|
||||
/// </summary>
|
||||
public Vector3 upDirection;
|
||||
|
||||
@@ -44,32 +45,22 @@ namespace RecrownedAthenaeum.Camera
|
||||
public Matrix projectionMatrix;
|
||||
|
||||
/// <summary>
|
||||
/// The graphics device used
|
||||
/// A basic effect that will be updated with the correct matrice information everytime <see cref="Apply"/> is called. Can be null and thus will not be used.
|
||||
/// </summary>
|
||||
protected GraphicsDevice graphicsDevice;
|
||||
|
||||
/// <summary>
|
||||
/// The basic effect that contains the transformations.
|
||||
/// </summary>
|
||||
public BasicEffect BasicEffect { get; protected set; }
|
||||
public BasicEffect basicEffect;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs 3D camera with an orthographic projection matrix with dimensions of graphics devices viewport. All changes to matrices should have apply called after changes.
|
||||
/// </summary>
|
||||
/// <param name="graphicsDevice">The graphics device to use. Will use graphics device from <see cref="Configuration"/>'s graphics device manager if this is null which it is by default.</param>
|
||||
public Camera3D(GraphicsDevice graphicsDevice = null)
|
||||
/// <param name="basicEffect">A basic effect that will be updated with the correct matrice information everytime <see cref="Apply"/> is called. Can be null and thus will not be used.</param>
|
||||
public BasicCamera(BasicEffect basicEffect = null)
|
||||
{
|
||||
graphicsDevice = graphicsDevice ?? (Configuration.GraphicsDeviceManager.GraphicsDevice);
|
||||
this.graphicsDevice = graphicsDevice;
|
||||
worldMatrix = Matrix.Identity;
|
||||
lookAt = Vector3.Forward;
|
||||
upDirection = Vector3.Up;
|
||||
|
||||
projectionMatrix = Matrix.Identity;
|
||||
|
||||
BasicEffect = new BasicEffect(graphicsDevice);
|
||||
BasicEffect.TextureEnabled = true;
|
||||
BasicEffect.VertexColorEnabled = true;
|
||||
this.basicEffect = basicEffect;
|
||||
Apply();
|
||||
}
|
||||
|
||||
@@ -81,9 +72,12 @@ namespace RecrownedAthenaeum.Camera
|
||||
ViewMatrix = Matrix.CreateLookAt(position, lookAt, upDirection);
|
||||
worldMatrix *= Matrix.CreateScale(worldScale);
|
||||
|
||||
BasicEffect.World = worldMatrix;
|
||||
BasicEffect.View = ViewMatrix;
|
||||
BasicEffect.Projection = projectionMatrix;
|
||||
if (basicEffect != null)
|
||||
{
|
||||
basicEffect.World = worldMatrix;
|
||||
basicEffect.Projection = projectionMatrix;
|
||||
basicEffect.View = ViewMatrix;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
@@ -5,10 +5,20 @@ using System;
|
||||
namespace RecrownedAthenaeum.Camera
|
||||
{
|
||||
/// <summary>
|
||||
/// A virtual 2D camera that wraps the normal <see cref="Camera3D"/>. Default projection is orthographic.
|
||||
/// A virtual 2D camera that wraps the normal <see cref="BasicCamera"/>. Default projection is orthographic.
|
||||
/// </summary>
|
||||
public class Camera2D : Camera3D
|
||||
public class Camera2D : BasicCamera
|
||||
{
|
||||
/// <summary>
|
||||
/// The width of the view of the camera.
|
||||
/// </summary>
|
||||
public int viewWidth;
|
||||
|
||||
/// <summary>
|
||||
/// The height of the view of the camera.
|
||||
/// </summary>
|
||||
public int viewHeight;
|
||||
|
||||
/// <summary>
|
||||
/// The 2D position.
|
||||
/// </summary>
|
||||
@@ -17,18 +27,21 @@ namespace RecrownedAthenaeum.Camera
|
||||
/// <summary>
|
||||
/// Places camera in the center given the corner position.
|
||||
/// </summary>
|
||||
public Vector2 CenterPosition { set { position.X = value.X + graphicsDevice.Viewport.Width / 2f; position.Y = value.Y + graphicsDevice.Viewport.Height / 2f; } }
|
||||
public Vector2 ConrnerPosition { set { position.X = value.X + viewWidth / 2f; position.Y = value.Y + viewHeight / 2f; } }
|
||||
|
||||
/// <summary>
|
||||
/// A 2D camera from the generic <see cref="Camera3D"/>.
|
||||
/// A 2D camera from the generic <see cref="BasicCamera"/>.
|
||||
/// </summary>
|
||||
/// <param name="graphicsDevice">The graphics device to use if not using the one in <see cref="Configuration"/>.</param>
|
||||
public Camera2D(GraphicsDevice graphicsDevice = null) : base(graphicsDevice)
|
||||
/// <param name="height">Width of camera view.</param>
|
||||
/// <param name="width">Height of camera view.</param>
|
||||
/// <param name="basicEffect">A basic effect that will be updated with the correct matrice information everytime <see cref="Apply"/> is called. Can be null and thus will not be used.</param>
|
||||
public Camera2D(int width, int height, BasicEffect basicEffect = null) : base(basicEffect)
|
||||
{
|
||||
projectionMatrix = Matrix.CreateOrthographic(this.graphicsDevice.Viewport.Width, this.graphicsDevice.Viewport.Height, 0, 1);
|
||||
CenterPosition = new Vector2(0, 0);
|
||||
this.viewWidth = width;
|
||||
this.viewHeight = height;
|
||||
upDirection = Vector3.Down;
|
||||
Apply();
|
||||
ConrnerPosition = new Vector2(0, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -37,6 +50,7 @@ namespace RecrownedAthenaeum.Camera
|
||||
/// </summary>
|
||||
public override void Apply()
|
||||
{
|
||||
projectionMatrix = Matrix.CreateOrthographic(viewWidth, viewHeight, 0, 1);
|
||||
position.Z = 0;
|
||||
lookAt = new Vector3(Position, 1f);
|
||||
base.Apply();
|
||||
|
89
RecrownedAthenaeum/Render/ConsistentSpriteBatch.cs
Normal file
89
RecrownedAthenaeum/Render/ConsistentSpriteBatch.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
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>
|
||||
/// A <see cref="SpriteBatch"/> that keeps it's settings through begin and end unless manually changed either by the <see cref="Begin(SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, Matrix?)"/> or through changing the fields. Note that changing the fields while the batch has begun will not take effect until the next time the batch is started.
|
||||
/// </summary>
|
||||
public class ConsistentSpriteBatch : SpriteBatch
|
||||
{
|
||||
/// <summary>
|
||||
/// How to blend the colors. Uses <see cref="SpriteBatch"/>'s default if not set before or during <see cref="Begin(SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, Matrix?)"/> call.
|
||||
/// Changes will only take effect on <see cref="Begin(SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, Matrix?)"/> call.
|
||||
/// </summary>
|
||||
public BlendState BlendState;
|
||||
|
||||
/// <summary>
|
||||
/// The state of sampler to use for the spritebatch. Uses <see cref="SpriteBatch"/>'s default if not set before or during <see cref="Begin(SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, Matrix?)"/> call.
|
||||
/// Changes will only take effect on <see cref="Begin(SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, Matrix?)"/> call.
|
||||
/// </summary>
|
||||
public SamplerState SamplerState;
|
||||
|
||||
/// <summary>
|
||||
/// The state of the depth-stencil buffer. Uses <see cref="SpriteBatch"/>'s defaultdefault if not set before or during <see cref="Begin(SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, Matrix?)"/> call.
|
||||
/// Changes will only take effect on <see cref="Begin(SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, Matrix?)"/> call.
|
||||
/// </summary>
|
||||
public DepthStencilState DepthStencilState;
|
||||
|
||||
/// <summary>
|
||||
/// The state of rasterizer to use. Uses <see cref="SpriteBatch"/>'s default if not set before or during <see cref="Begin(SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, Matrix?)"/> call.
|
||||
/// Changes will only take effect on <see cref="Begin(SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, Matrix?)"/> call.
|
||||
/// </summary>
|
||||
public RasterizerState RasterizerState;
|
||||
|
||||
/// <summary>
|
||||
/// An effect to apply to the batch. Uses <see cref="SpriteBatch"/>'s default if not set before or during <see cref="Begin(SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, Matrix?)"/> call.
|
||||
/// Changes will only take effect on <see cref="Begin(SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, Matrix?)"/> call.
|
||||
/// </summary>
|
||||
public Effect Effect;
|
||||
|
||||
/// <summary>
|
||||
/// A matrix to be applied to transform the sprites geometry. An identity matrix is used if not provided before or during <see cref="Begin(SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, Matrix?)"/> call.
|
||||
/// Changes will only take effect on <see cref="Begin(SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, Matrix?)"/> call.
|
||||
/// </summary>
|
||||
public Matrix? TransformMatrix;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a consistent sprite batch with default values.
|
||||
/// </summary>
|
||||
/// <param name="graphicsDevice">The graphics device to use to create a <see cref="SpriteBatch"/>.</param>
|
||||
public ConsistentSpriteBatch(GraphicsDevice graphicsDevice) : base(graphicsDevice)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Begins the consistent sprite batch.
|
||||
/// </summary>
|
||||
/// <param name="sortMode">Defines the spritebatch's method of sorting the items in each batch. Uses <see cref="SpriteBatch"/>'s default.</param>
|
||||
/// <param name="blendState">How to blend the colors. Uses <see cref="SpriteBatch"/>'s default if not set and field is also not set.</param>
|
||||
/// <param name="samplerState">The state of sampler to use for the spritebatch. Uses <see cref="SpriteBatch"/>'s default if not set and field is also not set.</param>
|
||||
/// <param name="depthStencilState">What type of rasterization to use. Uses <see cref="SpriteBatch"/>'s default if not set and field is also not set.</param>
|
||||
/// <param name="rasterizerState">What type of rasterization to use. Uses <see cref="SpriteBatch"/>'s default if not set and field is also not set.</param>
|
||||
/// <param name="effect">An effect to apply to the batch. Uses <see cref="SpriteBatch"/>'s default if not set and field is also not set.</param>
|
||||
/// <param name="transformMatrix">A matrix to be applied to transform the sprites geometry. An identity is used if not provided.</param>
|
||||
public new void Begin(SpriteSortMode sortMode = SpriteSortMode.Deferred, BlendState blendState = null, SamplerState samplerState = null, DepthStencilState depthStencilState = null, RasterizerState rasterizerState = null, Effect effect = null, Matrix? transformMatrix = null)
|
||||
{
|
||||
if (blendState != null) this.BlendState = blendState;
|
||||
if (samplerState != null) this.SamplerState = samplerState;
|
||||
if (depthStencilState != null) this.DepthStencilState = depthStencilState;
|
||||
if (rasterizerState != null) this.RasterizerState = rasterizerState;
|
||||
if (effect != null) this.Effect = effect;
|
||||
if (transformMatrix != null) this.TransformMatrix = transformMatrix;
|
||||
|
||||
base.Begin(
|
||||
sortMode: sortMode,
|
||||
blendState: blendState,
|
||||
samplerState: samplerState,
|
||||
depthStencilState: depthStencilState,
|
||||
rasterizerState: rasterizerState,
|
||||
effect: effect,
|
||||
transformMatrix: transformMatrix);
|
||||
}
|
||||
}
|
||||
}
|
@@ -12,7 +12,7 @@ namespace RecrownedAthenaeum.Render
|
||||
{
|
||||
VertexPositionColor[] vertices;
|
||||
int bufferPosition;
|
||||
BasicEffect basicEffect;
|
||||
Effect effect;
|
||||
PrimitiveType primitiveType;
|
||||
private int verticesPerPrimitive;
|
||||
|
||||
@@ -24,28 +24,26 @@ namespace RecrownedAthenaeum.Render
|
||||
GraphicsDevice graphicsDevice;
|
||||
bool began;
|
||||
bool disposed;
|
||||
Camera3D camera;
|
||||
|
||||
|
||||
BasicEffect basicEffect;
|
||||
/// <summary>
|
||||
/// Creates a batch used to draw primitives.
|
||||
/// </summary>
|
||||
/// <param name="camera">The current camera being used. Will use default set in <see cref="Configuration"/> if left null.</param>
|
||||
/// <param name="graphicsDevice">The graphics device used to draw the primitives. Will be using <see cref="Configuration"/>'s graphics device from graphics device manager if null. Default is null.</param>
|
||||
/// <param name="graphicsDevice">The graphics device used to draw the primitives.</param>
|
||||
/// <param name="verticesPerBatch">The amount of vertices every batch can hold before flushing. Default is 450. Should be changed to be the most optimal number if possible to prevent unnecessary resizing. Especially if using strip primitive types.</param>
|
||||
public PrimitiveBatch(Camera2D camera = null, GraphicsDevice graphicsDevice = null, int verticesPerBatch = 500)
|
||||
public PrimitiveBatch(GraphicsDevice graphicsDevice, int verticesPerBatch = 500)
|
||||
{
|
||||
this.graphicsDevice = graphicsDevice ?? (Configuration.GraphicsDeviceManager.GraphicsDevice);
|
||||
this.camera = camera ?? (Configuration.Camera2D);
|
||||
basicEffect = new BasicEffect(this.graphicsDevice);
|
||||
basicEffect.VertexColorEnabled = true;
|
||||
vertices = new VertexPositionColor[verticesPerBatch + 1];
|
||||
this.graphicsDevice = graphicsDevice;
|
||||
basicEffect = new BasicEffect(graphicsDevice);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts the batch. Batch cannot be started twice.
|
||||
/// </summary>
|
||||
/// <param name="primitiveType">The type of primitive this batch would be drawing.</param>
|
||||
public void Begin(PrimitiveType primitiveType)
|
||||
/// <param name="effect">Effect to use to render the primitives. Default will use a <see cref="BasicEffect"/>.</param>
|
||||
public void Begin(PrimitiveType primitiveType, Effect effect = null)
|
||||
{
|
||||
if (began) throw new InvalidOperationException("Begin is being called twice before being ended.");
|
||||
if (disposed) throw new ObjectDisposedException(this.GetType().Name);
|
||||
@@ -57,9 +55,7 @@ namespace RecrownedAthenaeum.Render
|
||||
case PrimitiveType.LineStrip: verticesPerPrimitive = 1; break;
|
||||
case PrimitiveType.TriangleStrip: verticesPerPrimitive = 3; break;
|
||||
}
|
||||
basicEffect.World = camera.worldMatrix;
|
||||
basicEffect.View = camera.ViewMatrix;
|
||||
basicEffect.Projection = camera.projectionMatrix;
|
||||
this.effect = effect ?? basicEffect;
|
||||
began = true;
|
||||
}
|
||||
|
||||
@@ -116,7 +112,7 @@ namespace RecrownedAthenaeum.Render
|
||||
if (disposed) throw new ObjectDisposedException(this.GetType().Name);
|
||||
if (bufferPosition == 0) return;
|
||||
if (primitiveCount == 0) primitiveCount = bufferPosition / verticesPerPrimitive;
|
||||
foreach (EffectPass effectPass in basicEffect.CurrentTechnique.Passes)
|
||||
foreach (EffectPass effectPass in effect.CurrentTechnique.Passes)
|
||||
{
|
||||
effectPass.Apply();
|
||||
graphicsDevice.DrawUserPrimitives(primitiveType, vertices, 0, primitiveCount);
|
||||
|
@@ -20,11 +20,10 @@ namespace RecrownedAthenaeum.Render
|
||||
/// <summary>
|
||||
/// Creates a rectangle renderer with the given <see cref="PrimitiveBatch"/>.
|
||||
/// </summary>
|
||||
/// <param name="camera">Camera to use for <see cref="PrimitiveBatch"/>. Default will use <see cref="Configuration"/>.</param>
|
||||
/// <param name="graphicsDevice">Graphics device to use. Default will use <see cref="Configuration"/>.</param>
|
||||
public RectangleRenderer(Camera2D camera = null, GraphicsDevice graphicsDevice = null)
|
||||
/// <param name="graphicsDevice">Graphics device to use.</param>
|
||||
public RectangleRenderer(GraphicsDevice graphicsDevice)
|
||||
{
|
||||
primitiveBatch = new PrimitiveBatch(camera, graphicsDevice);
|
||||
primitiveBatch = new PrimitiveBatch(graphicsDevice);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@@ -9,23 +9,33 @@ namespace RecrownedAthenaeum.Render
|
||||
public class ScissorBox
|
||||
{
|
||||
|
||||
SpriteBatch spriteBatch;
|
||||
Rectangle currentScissorRect;
|
||||
ConsistentSpriteBatch spriteBatch;
|
||||
Rectangle originalScissor;
|
||||
RasterizerState originalRasterizerState;
|
||||
|
||||
RasterizerState scissorRasterizerState;
|
||||
|
||||
/// <summary>
|
||||
/// Used to crop off anything that doesn't fit into the defined space.
|
||||
/// </summary>
|
||||
public ScissorBox()
|
||||
{
|
||||
scissorRasterizerState = new RasterizerState();
|
||||
scissorRasterizerState.ScissorTestEnable = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts spritebatch with scissoring enabled.
|
||||
/// </summary>
|
||||
/// <param name="rectangle"></param>
|
||||
/// <param name="spriteBatch"></param>
|
||||
/// <param name="spriteBatchSettings">The settings for using the <see cref="SpriteBatch"/> to perform the scissor.</param>
|
||||
public void Begin(Rectangle rectangle, SpriteBatch spriteBatch, SpriteBatchSettings? spriteBatchSettings = null)
|
||||
public void Begin(Rectangle rectangle, ConsistentSpriteBatch spriteBatch)
|
||||
{
|
||||
if (spriteBatchSettings == null) spriteBatchSettings = Configuration.SpriteBatchSettings;
|
||||
|
||||
this.spriteBatch = spriteBatch;
|
||||
spriteBatchSettings.Value.rasterizerState.ScissorTestEnable = true;
|
||||
spriteBatchSettings.Value.BeginSpriteBatch(spriteBatch);
|
||||
currentScissorRect = spriteBatch.GraphicsDevice.ScissorRectangle;
|
||||
originalRasterizerState = spriteBatch.RasterizerState;
|
||||
spriteBatch.Begin(rasterizerState: scissorRasterizerState);
|
||||
|
||||
originalScissor = spriteBatch.GraphicsDevice.ScissorRectangle;
|
||||
spriteBatch.GraphicsDevice.ScissorRectangle = rectangle;
|
||||
}
|
||||
|
||||
@@ -34,7 +44,8 @@ namespace RecrownedAthenaeum.Render
|
||||
/// </summary>
|
||||
public void End()
|
||||
{
|
||||
spriteBatch.GraphicsDevice.ScissorRectangle = currentScissorRect;
|
||||
spriteBatch.GraphicsDevice.ScissorRectangle = originalScissor;
|
||||
spriteBatch.RasterizerState = originalRasterizerState;
|
||||
spriteBatch.End();
|
||||
}
|
||||
}
|
||||
|
@@ -1,76 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
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>
|
||||
/// See <see cref="SpriteBatch.Begin(SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, Matrix?)"/> for uses and defaults.
|
||||
/// </summary>
|
||||
/// <param name="spriteSortMode"></param>
|
||||
/// <param name="blendState"></param>
|
||||
/// <param name="samplerState"></param>
|
||||
/// <param name="depthStencilState"></param>
|
||||
/// <param name="rasterizerState"></param>
|
||||
/// <param name="effect"></param>
|
||||
/// <param name="transformMatrix"></param>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <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