#region usings
using OpenTK.Graphics.OpenGL4;
using SM.Base.Contexts;
using SM.OGL.Shaders;
#endregion
namespace SM.Base.Drawing
{
///
/// A general class to work with material shaders properly.
///
public abstract class MaterialShader : GenericShader
{
///
protected MaterialShader(string combinedData) : base(combinedData)
{}
///
protected MaterialShader(string vertex, string fragment) : base(vertex, fragment)
{
}
///
protected MaterialShader(ShaderFileCollection shaderFileFiles) : base(shaderFileFiles)
{
}
///
/// Prepares the context for the drawing.
///
/// The context
public virtual void Draw(DrawContext context)
{
GL.UseProgram(this);
GL.BindVertexArray(context.Mesh);
DrawProcess(context);
CleanUp();
GL.UseProgram(0);
context.ShaderArguments.Clear();
}
///
/// Draws the context.
///
///
protected abstract void DrawProcess(DrawContext context);
}
}