Files
MonoGame.Extended/Source/Demos/Demo.Batching/SpriteMaterial.cs
T
Lucas Girouard-StranksandDylan Wilson b6cf784a80 DynamicBatch2D - SpriteBatch API (#251)
* Matrix2D ToMatrix

* Merge draw calls when enqueueing.

* progress

* Batch2D sort modes

* SpriteBatch API for Batch2D

* doc fix

* doc fix

* DynamicBatch2D drawing API matches SpriteBatch

* Make End() protected

* Match SpriteBatch.Begin API

* DynamicBatch2D DrawSprite by destination rectangle

* GetPrimitiveCount -> GetPrimitivesCount

* doc fix
2016-09-02 20:32:18 +10:00

22 lines
491 B
C#

using Microsoft.Xna.Framework.Graphics;
using MonoGame.Extended.Graphics;
namespace Demo.PrimitiveBatch
{
public class SpriteMaterial : EffectMaterial<SpriteEffect>
{
public Texture2D Texture { get; }
public SpriteMaterial(SpriteEffect effect, Texture2D texture)
: base(effect)
{
Texture = texture;
}
public override void Apply(out Effect effect)
{
Effect.Texture = Texture;
}
}
}