using SM.Base.Contexts;
using SM.Base.Objects.Static;
using SM.OGL.Mesh;
namespace SM.Base.Scene
{
///
/// Contains general basis systems for drawing objects.
///
public abstract class DrawingBasis : IShowItem
{
///
/// The material it should use.
///
protected Material _material = new Material();
///
/// The mesh it should use.
///
protected GenericMesh _mesh = Defaults.DefaultMesh;
///
public virtual void Update(UpdateContext context)
{
}
///
public virtual void Draw(DrawContext context)
{
}
///
/// Applies the current settings to the context.
///
///
protected void ApplyContext(ref DrawContext context)
{
_material.Shader ??= Defaults.DefaultShader;
context.Material = _material;
context.Mesh = _mesh;
}
}
///
/// Contains general basis systems for drawing objects.
///
/// The transformation type
public abstract class DrawingBasis : DrawingBasis
where TTransformation : GenericTransformation, new()
{
///
/// The current transformation.
///
public TTransformation Transform = new TTransformation();
}
}