Loads and loads of small improvements I added while developing on my game
This commit is contained in:
parent
41421b1df9
commit
a7c71e7ea1
107 changed files with 2278 additions and 1023 deletions
|
|
@ -1,55 +0,0 @@
|
|||
#region usings
|
||||
|
||||
using OpenTK.Graphics.OpenGL4;
|
||||
using SM.Base.Contexts;
|
||||
using SM.OGL.Shaders;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace SM.Base.Drawing
|
||||
{
|
||||
/// <summary>
|
||||
/// A general class to work with material shaders properly.
|
||||
/// </summary>
|
||||
public abstract class MaterialShader : GenericShader
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected MaterialShader(string combinedData) : base(combinedData)
|
||||
{}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected MaterialShader(string vertex, string fragment) : base(vertex, fragment)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected MaterialShader(ShaderFileCollection shaderFileFiles) : base(shaderFileFiles)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prepares the context for the drawing.
|
||||
/// </summary>
|
||||
/// <param name="context">The context</param>
|
||||
public virtual void Draw(DrawContext context)
|
||||
{
|
||||
GL.UseProgram(this);
|
||||
|
||||
GL.BindVertexArray(context.Mesh);
|
||||
|
||||
DrawProcess(context);
|
||||
|
||||
CleanUp();
|
||||
|
||||
GL.UseProgram(0);
|
||||
|
||||
context.ShaderArguments.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the context.
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
protected abstract void DrawProcess(DrawContext context);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue