from this, we'll autogenerate a class which essentially does this: ```cs public class Buffer : IDisp

from this, we'll autogenerate a class which essentially does this:
public class Buffer : IDisposable
{
    public GL Api { get; }
    public uint Handle { get; }
}

which will result in something like this:
var gl = GL.GetApi();
var buffer = gl.CreateBuffer();
gl.BindBuffer(buffer, ...);
gl.NamedBufferData(buffer, ...);
gl.DeleteBuffer(buffer);

being turned into this:
var gl = GL.GetApi();
var buffer = new Buffer(gl);
buffer.Bind();
buffer.NamedBufferData(...);
buffer.Dispose(); // alternatively use C# 8's using var if the buffer is short-lived, like a staging buffer
Was this page helpful?