using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace StgSharp.Graphics { /// /// Interface of all kinds OpenGL buffer onjects /// public abstract class IBufferObject : IDisposable { protected glHandle _bufferHandle; protected IglFunc GL; /// /// Get the only handle to one of the Object instance /// /// /// public uint this[int index] { get { return _bufferHandle[index]; } } /// /// Bind a buffer instance to OpenGL /// /// Index of handle of the object in this instance to be bind public abstract void Bind(int index); protected abstract void Dispose(bool disposing); ~IBufferObject() { Dispose(disposing: false); } public void Dispose() { Dispose(disposing: true); GC.SuppressFinalize(this); } } }