20.09.2020
+ Instance Drawing + Text and Font ~ Made "DrawBackground" forced Background for 2D - DrawEmpty
This commit is contained in:
parent
acccf5f0e7
commit
c4a0847567
29 changed files with 365 additions and 85 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
@ -7,6 +7,5 @@ namespace SM.Base.Scene
|
|||
public interface IShader
|
||||
{
|
||||
void Draw(DrawContext context);
|
||||
void DrawInstanced(DrawContext context, ICollection<Matrix4> instanceCollection);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace SM.Base.Scene
|
||||
{
|
||||
public interface IShowCollection
|
||||
{
|
||||
List<IShowItem> Objects { get; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
using SM.Base.Contexts;
|
||||
|
||||
namespace SM.Base.Scene
|
||||
{
|
||||
public interface IShowItem
|
||||
{
|
||||
void Update(UpdateContext context);
|
||||
void Draw(DrawContext context);
|
||||
}
|
||||
}
|
||||
11
SMCode/SM.Base/Drawing/Instance.cs
Normal file
11
SMCode/SM.Base/Drawing/Instance.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
using OpenTK;
|
||||
|
||||
namespace SM.Base.Scene
|
||||
{
|
||||
public struct Instance
|
||||
{
|
||||
public Matrix4 ModelMatrix;
|
||||
public Vector2 TexturePosition;
|
||||
public Vector2 TextureScale;
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue