17.09.2020

+ Generic Scene
+ Generic Camera
+ Generic Window
+ Contexts for drawing and updateing

+ very basic 2D-implermention
This commit is contained in:
Michel Fedde 2020-09-17 21:28:16 +02:00
parent 9889366317
commit 589d131246
25 changed files with 383 additions and 78 deletions

View file

@ -0,0 +1,23 @@
using System.Collections.Generic;
using SM.Base.Contexts;
namespace SM.Base.Scene
{
public abstract class GenericScene<TCamera> : IShowCollection
where TCamera : GenericCamera
{
public List<IShowItem> Objects { get; } = new List<IShowItem>();
public TCamera Camera { get; set; }
public Dictionary<string, TCamera> Cameras = new Dictionary<string, TCamera>();
public void Draw(DrawContext context)
{
if (!context.ForceViewport && Camera != null) context.View = Camera.ViewMatrix;
for(int i = 0; i < Objects.Count; i++)
Objects[i].Draw(context);
}
}
}