mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-24 12:06:37 +00:00
* 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
22 lines
491 B
C#
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;
|
|
}
|
|
}
|
|
}
|