20.09.2020

+ Instance Drawing
+ Text and Font

~ Made "DrawBackground" forced Background for 2D

- DrawEmpty
This commit is contained in:
Michel Fedde 2020-09-20 18:29:09 +02:00
parent acccf5f0e7
commit c4a0847567
29 changed files with 365 additions and 85 deletions

View file

@ -4,7 +4,7 @@ using SM.OGL.Mesh;
namespace SM.Base.Scene
{
public class DrawingBasis : IShowItem
public abstract class DrawingBasis : IShowItem
{
protected Material _material = new Material();
protected Mesh _mesh = Plate.Object;
@ -22,10 +22,9 @@ namespace SM.Base.Scene
context.Mesh = _mesh;
}
}
public class DrawingBasis<TTransformation> : DrawingBasis
public abstract class DrawingBasis<TTransformation> : DrawingBasis
where TTransformation : GenericTransformation, new()
{
public TTransformation Transform = new TTransformation();
}
}

View file

@ -7,6 +7,5 @@ namespace SM.Base.Scene
public interface IShader
{
void Draw(DrawContext context);
void DrawInstanced(DrawContext context, ICollection<Matrix4> instanceCollection);
}
}

View file

@ -1,9 +0,0 @@
using System.Collections.Generic;
namespace SM.Base.Scene
{
public interface IShowCollection
{
List<IShowItem> Objects { get; }
}
}

View file

@ -1,10 +0,0 @@
using SM.Base.Contexts;
namespace SM.Base.Scene
{
public interface IShowItem
{
void Update(UpdateContext context);
void Draw(DrawContext context);
}
}

View file

@ -0,0 +1,11 @@
using OpenTK;
namespace SM.Base.Scene
{
public struct Instance
{
public Matrix4 ModelMatrix;
public Vector2 TexturePosition;
public Vector2 TextureScale;
}
}

View file

@ -7,7 +7,7 @@ namespace SM.Base.Scene
public class Material
{
public TextureBase Texture;
public Color4 Tint;
public Color4 Tint = Color4.White;
public IShader Shader = Shaders.Default;
}