internal void GenerateBuffer <T>() where T : struct, IVertexType { var vd = VertexDeclaration.FromType(_type); _size = vd.VertexStride * ((T[])_buffer).Length; All11 bufferUsage = (_bufferUsage == BufferUsage.WriteOnly) ? All11.StaticDraw : All11.DynamicDraw; GL11.GenBuffers(1, out _bufferStore); GL11.BindBuffer(All11.ArrayBuffer, _bufferStore); GL11.BufferData <T>(All11.ArrayBuffer, (IntPtr)_size, (T[])_buffer, bufferUsage); }
public void Dispose() { GL11.GenBuffers(0, out _bufferStore); }