Files
stgsharp/源代码/StgSharp/Graphics/GL/Buffer/IBufferObject.cs
T

47 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Graphics
{
/// <summary>
/// Interface of all kinds OpenGL buffer onjects
/// </summary>
public abstract class IBufferObject : IDisposable
{
protected uint[] _bufferID;
protected IglFunc GL;
/// <summary>
/// Get the only handle to one of the Object instance
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
public uint this[int index]
{
get { return _bufferID[index]; }
}
/// <summary>
/// Bind a buffer instance to OpenGL
/// </summary>
/// <param name="index">Index of handle of the object in this instance to be bind</param>
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);
}
}
}