From 4420f20a901ed1f96d9fb8f4df0148bc0bc3666d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 7 Mar 2026 12:32:55 +0000 Subject: Add glVertexArray useBuffer Wraps glVertexArrayVertexBuffer automatically getting the buffer name from the argument and deriving the stride from the container's value_type. --- gfx/gl/glVertexArray.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gfx/gl/glVertexArray.h') 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 + void + useBuffer(GLuint binding, const GlAllocated & buffer) const + requires requires { + { buffer.bufferName() } -> std::same_as; + } + { + using T = typename GlAllocated::value_type; + glVertexArrayVertexBuffer(name, binding, buffer.bufferName(), 0, sizeof(T)); + } }; } -- cgit v1.3