This repository has been archived on 2026-05-22. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Tetrahedrons/Platformer/Util/VertexArray.cs

27 lines
746 B
C#

using OpenTK.Graphics.OpenGL4;
namespace Platformer.Util
{
public class VertexArray : GlObj
{
public VertexArray() : base(GL.GenVertexArray())
{
}
public void VertexPointer<T>(Buffer<T> buffer, int index, int size,
VertexAttribPointerType type = VertexAttribPointerType.Float,
bool normalized = false, int stride = 0, int offset = 0)
where T : struct
{
GL.BindVertexArray(this);
GL.BindBuffer(BufferTarget.ArrayBuffer, buffer);
GL.VertexAttribPointer(index, size, type, normalized, stride, offset);
GL.BindBuffer(BufferTarget.ArrayBuffer, 0);
GL.EnableVertexArrayAttrib(this, index);
GL.BindVertexArray(0);
}
}
}