/// <summary> /// Buffers the entire local array to designated storage /// </summary> /// <remarks>Where the data is stored is implementation specific, and the usage variable is considered a hint, not a command.</remarks> /// <param name="usage">Data usage.</param> /// <seealso cref="Glorg2.Graphics.OpenGL.OpenGL.VboUsage"/> public void BufferData(VboUsage usage) { OpenGL.glBindBuffer(target, handle); var h = System.Runtime.InteropServices.GCHandle.Alloc(internal_array, System.Runtime.InteropServices.GCHandleType.Pinned); OpenGL.glBufferData(target, new IntPtr(size_of_t * internal_array.Length), h.AddrOfPinnedObject(), (uint)usage); h.Free(); }
/// <summary> /// Sets the current vertex buffer object as null (disabling vertex buffer objects) /// </summary> public virtual void MakeNonCurrent() { OpenGL.glBindBuffer(target, 0); }
/// <summary> /// Sets the current vertex buffer object to this /// </summary> public virtual void MakeCurrent() { OpenGL.glBindBuffer(target, handle); }