18.09.2020

+ Textures
~ Changed 2D coordnate system to lower right as XY+
This commit is contained in:
Michel Fedde 2020-09-19 15:04:04 +02:00
parent 589d131246
commit a603ecc417
26 changed files with 267 additions and 16 deletions

View file

@ -0,0 +1,28 @@
using SM.Base.Contexts;
using SM.Base.StaticObjects;
using SM.OGL.Mesh;
namespace SM.Base.Scene
{
public class DrawingBasis<TTransformation> : IShowItem
where TTransformation : GenericTransformation, new()
{
protected Material _material = new Material();
protected Mesh _mesh = Plate.Object;
public TTransformation Transform = new TTransformation();
public virtual void Update(UpdateContext context)
{
}
public virtual void Draw(DrawContext context)
{ }
protected void ApplyContext(ref DrawContext context)
{
context.Material = _material;
context.Mesh = _mesh;
}
}
}

View file

@ -0,0 +1,9 @@
using OpenTK;
namespace SM.Base.Scene
{
public abstract class GenericTransformation
{
public abstract Matrix4 GetMatrix();
}
}

View file

@ -0,0 +1,12 @@
using System.Collections.Generic;
using OpenTK;
using SM.Base.Contexts;
namespace SM.Base.Scene
{
public interface IShader
{
void Draw(DrawContext context);
void DrawInstanced(DrawContext context, ICollection<Matrix4> instanceCollection);
}
}

View file

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

View file

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

View file

@ -0,0 +1,14 @@
using OpenTK.Graphics;
using SM.Base.Shader;
using SM.OGL.Texture;
namespace SM.Base.Scene
{
public class Material
{
public TextureBase Texture;
public Color4 Tint;
public IShader Shader = Shaders.Default;
}
}