add platformer window infrastructure

This commit is contained in:
2018-04-08 20:29:20 -04:00
parent edb2985a98
commit f175dd84f4
12 changed files with 328 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
using OpenTK.Graphics.OpenGL4;
namespace Platformer.Util
{
public class VertexArray : GlObj
{
public VertexArray() : base(GL.GenVertexArray())
{
}
public void VertexPointer(Buffer buffer, int index, int size,
VertexAttribPointerType type = VertexAttribPointerType.Float,
bool normalized = false, int stride = 0, int offset = 0)
{
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);
}
}
}