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

33
SM.Core/GLObject.cs Normal file
View file

@ -0,0 +1,33 @@
using OpenTK.Graphics.OpenGL4;
namespace SM.OGL
{
public abstract class GLObject
{
protected int _id = -1;
protected virtual bool AutoCompile { get; } = false;
public virtual int ID
{
get
{
if (AutoCompile && _id < 0) Compile();
return _id;
}
}
public abstract ObjectLabelIdentifier TypeIdentifier { get; }
protected virtual void Compile()
{
}
public void Name(string name)
{
GL.ObjectLabel(TypeIdentifier, _id, name.Length, name);
}
public static implicit operator int(GLObject glo) => glo.ID;
}
}