starting compute shader for tetrahedron intersections

This commit is contained in:
2018-04-09 18:22:02 -04:00
parent f175dd84f4
commit 6539dd5ee6
9 changed files with 303 additions and 127 deletions

View File

@@ -2,25 +2,26 @@
namespace Platformer.Util
{
public class VertexArray : GlObj
{
public VertexArray() : base(GL.GenVertexArray())
{
}
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);
}
}
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);
}
}
}