Added summeries to SM.OGL
This commit is contained in:
parent
2aa12f8d25
commit
16366fa015
15 changed files with 363 additions and 27 deletions
|
|
@ -2,13 +2,29 @@
|
|||
|
||||
namespace SM.OGL
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies default object behaviour.
|
||||
/// </summary>
|
||||
public abstract class GLObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains the OpenGL ID
|
||||
/// </summary>
|
||||
protected int _id = -1;
|
||||
/// <summary>
|
||||
/// If true, the system will call "Compile()", when "ID" is tried to get, but the id is still -1.
|
||||
/// </summary>
|
||||
protected virtual bool AutoCompile { get; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the object was compiled.
|
||||
/// </summary>
|
||||
public bool WasCompiled => _id > 0;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the id for this object.
|
||||
/// <para>It will auto compile, if needed and allowed.</para>
|
||||
/// </summary>
|
||||
public virtual int ID
|
||||
{
|
||||
get
|
||||
|
|
@ -18,18 +34,32 @@ namespace SM.OGL
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Identifies the object.
|
||||
/// </summary>
|
||||
public abstract ObjectLabelIdentifier TypeIdentifier { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The action, that is called, when "ID" tries to compile something.
|
||||
/// </summary>
|
||||
protected virtual void Compile()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Names the object for debugging.
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
public void Name(string name)
|
||||
{
|
||||
if (GLSystem.Debugging) GL.ObjectLabel(TypeIdentifier, _id, name.Length, name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the ID for the object.
|
||||
/// </summary>
|
||||
/// <param name="glo"></param>
|
||||
public static implicit operator int(GLObject glo) => glo.ID;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue