16.09.2020
~ Fixed shading import ~ Fixed "Plate" mesh ~ Move the dll files into "SMCode"
This commit is contained in:
parent
421d03f91d
commit
9889366317
27 changed files with 30 additions and 17 deletions
33
SMCode/SM.OGL/GLObject.cs
Normal file
33
SMCode/SM.OGL/GLObject.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue