summaryrefslogtreecommitdiff
path: root/gfx/gl/glVertexArray.h
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/gl/glVertexArray.h')
-rw-r--r--gfx/gl/glVertexArray.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gfx/gl/glVertexArray.h b/gfx/gl/glVertexArray.h
index 3594cbf..3790863 100644
--- a/gfx/gl/glVertexArray.h
+++ b/gfx/gl/glVertexArray.h
@@ -115,6 +115,17 @@ namespace Impl {
{
return VertexArrayConfigurator {name};
}
+
+ template<typename GlAllocated>
+ void
+ useBuffer(GLuint binding, const GlAllocated & buffer) const
+ requires requires {
+ { buffer.bufferName() } -> std::same_as<GLuint>;
+ }
+ {
+ using T = typename GlAllocated::value_type;
+ glVertexArrayVertexBuffer(name, binding, buffer.bufferName(), 0, sizeof(T));
+ }
};
}