public GLBufferDynamic(GLBufferSettings settings, int size, int startCapacity = 8192)
        {
            Settings    = settings;
            ElementSize = size;
            BufferSize  = startCapacity;

            BufferId = GL.GenBuffer();
            Bind();
            {
                GL.BufferData(Settings.Target, BufferSize, IntPtr.Zero, Settings.Hint);
            }
            Unbind();
        }
Exemple #2
0
        public GLBuffer(GLBufferSettings settings, IList <T> buffer)
        {
            Buffer   = buffer;
            Settings = settings;

            BufferSize = Marshal.SizeOf(buffer[0]) * Buffer.Count;

            BufferId = GL.GenBuffer();

            Bind();
            {
                GL.BufferData(Settings.Target, BufferSize, Buffer.ToArray(), Settings.Hint);
            }
            Unbind();
        }