Files
MonoGame.Extended/Source/MonoGame.Extended.Graphics/Batching/ImmediateBatchCommandQueue.cs
T
Lucas Girouard-StranksandDylan Wilson d0c621d0dc Create Graphics library. (#316)
* Fix BoundingRect unit tests.

* Create `graphics` library.
2016-11-27 22:51:59 +10:00

29 lines
1.0 KiB
C#

using Microsoft.Xna.Framework.Graphics;
namespace MonoGame.Extended.Graphics.Batching
{
internal sealed class ImmediateBatchCommandQueue<TVertexType, TCommandData> :
BatchCommandQueue<TVertexType, TCommandData>
where TVertexType : struct, IVertexType
where TCommandData : struct, IBatchDrawCommandData<TCommandData>
{
public ImmediateBatchCommandQueue(GraphicsDevice graphicsDevice,
BatchCommandDrawer<TVertexType, TCommandData> batchCommandDrawer)
: base(graphicsDevice, batchCommandDrawer)
{
}
protected internal override void Flush()
{
}
internal override void EnqueueDrawCommand(ushort startIndex, ushort primitiveCount, float sortKey,
ref TCommandData data)
{
CommandDrawer.SelectBuffers();
var command = new BatchDrawCommand<TCommandData>(startIndex, primitiveCount, sortKey, data);
CommandDrawer.Draw(ref command);
CommandDrawer.GeometryBuffer.Clear();
}
}
}