Files
MonoGame.Extended/Source/MonoGame.Extended.Graphics/Batching/BatchCommandQueue.cs
T
Lucas Girouard-StranksandDylan Wilson b3b634fbad DynamicBatch rework (#317)
* Fix BoundingRect unit tests.

* Create `graphics` library.

* DynamicBatchRenderer2D

* remove sprite

* remove shipbuilder artifact
2016-11-29 20:03:46 +10:00

38 lines
1.4 KiB
C#

using System;
using Microsoft.Xna.Framework.Graphics;
using MonoGame.Extended.Graphics.Geometry;
namespace MonoGame.Extended.Graphics.Batching
{
internal abstract class BatchCommandQueue<TVertexType, TIndexType, TCommandData>
where TVertexType : struct, IVertexType where TIndexType : struct where TCommandData : struct, IBatchDrawCommandData<TCommandData>
{
internal BatchCommandDrawer<TVertexType, TIndexType, TCommandData> CommandDrawer;
internal GraphicsDevice GraphicsDevice;
internal GraphicsGeometryData<TVertexType, TIndexType> GeometryData;
protected BatchCommandQueue(GraphicsDevice graphicsDevice,
BatchCommandDrawer<TVertexType, TIndexType, TCommandData> commandDrawer, GraphicsGeometryData<TVertexType, TIndexType> geometryData)
{
GraphicsDevice = graphicsDevice;
CommandDrawer = commandDrawer;
GeometryData = geometryData;
}
internal virtual void Begin(Effect effect)
{
CommandDrawer.Effect = effect;
}
protected internal abstract void Flush();
internal void End()
{
Flush();
CommandDrawer.Effect = null;
}
internal abstract void EnqueueDrawCommand(PrimitiveType primitiveType, int primitiveCount, int startIndex, float sortKey,
ref TCommandData data);
}
}