smrendererv3/SMCode/SM2D/Scene/Scene.cs
Michel Fedde c6bf5c75bc 2021-04-03
+ Added Field to DrawingBasis to enfore PrimitiveTypes
+ LastObject to context for Debugging
+ AppendRenderbuffer to Framebuffer

~ Added a depthbuffer to RenderPipeline.CreateWindowFramebuffer
~ Proper ZIndices over Z-Translation and DepthBuffer
~ Made "ShaderArguments["LineWidth"]" set the LineWidth even if the object isn't maked as LineMesh
~ Made that the SM2D.PolygonVertex can translate OpenTK.Vector2 by itself.
~ Made the SM2D.Transformation.ZIndex a CVector1 instead a float
2021-03-04 22:17:03 +01:00

59 lines
No EOL
1.3 KiB
C#

#region usings
using System.Drawing.Drawing2D;
using OpenTK;
using OpenTK.Graphics;
using SM.Base;
using SM.Base.Objects.Static;
using SM.Base.Scene;
using SM.Base.Windows;
using SM2D.Drawing;
#endregion
namespace SM2D.Scene
{
public class Scene : GenericScene<Camera, ItemCollection>
{
private static DrawObject2D _axisHelper;
public float AxisHelperSize = 100;
static Scene()
{
_axisHelper = new DrawObject2D();
_axisHelper.Mesh = AxisHelper.Object;
}
public Scene()
{
_Background = new DrawBackground(Color4.Black);
Objects = new ItemCollection();
BackgroundCamera = new Camera();
HUDCamera = new Camera();
}
public DrawBackground Background
{
get => (DrawBackground) _Background;
set => _Background = value;
}
public override void DrawHUD(DrawContext context)
{
context.ModelMatrix *= Matrix4.CreateTranslation(0,0,1);
base.DrawHUD(context);
}
public override void DrawDebug(DrawContext context)
{
if (ShowAxisHelper)
{
_axisHelper.Transform.Size.Set(AxisHelperSize, AxisHelperSize);
_axisHelper.Draw(context);
}
}
}
}