15.09.2020

Everything currently don't work / can't be tested.

+ Generic Shader-Implermentation
+ Mesh-System + Plate-Mesh
This commit is contained in:
Michel Fedde 2020-09-15 22:16:18 +02:00
parent 551d393ac2
commit 421d03f91d
24 changed files with 726 additions and 4 deletions

View file

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using OpenTK.Graphics.OpenGL4;
namespace SM.OGL.Shaders
{
public class UniformCollection : Dictionary<string, Uniform>
{
internal GenericShader _parentShader;
public new Uniform this[string key]
{
get
{
try
{
return base[key];
}
catch (KeyNotFoundException)
{
Console.WriteLine("[Error] Uniform '"+key+"' was not found. Tried to recreate it.");
Uniform u = new Uniform(GL.GetUniformLocation(_parentShader, key), this);
Add(key, u);
return u;
}
}
}
public void Add(string key, int location)
{
base.Add(key, new Uniform(location, this));
}
}
}