summaryrefslogtreecommitdiff
path: root/gfx/gl
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/gl')
-rw-r--r--gfx/gl/glVertexArray.h11
-rw-r--r--gfx/gl/instanceVertices.h2
2 files changed, 13 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));
+ }
};
}
diff --git a/gfx/gl/instanceVertices.h b/gfx/gl/instanceVertices.h
index f24eaa3..2643e68 100644
--- a/gfx/gl/instanceVertices.h
+++ b/gfx/gl/instanceVertices.h
@@ -126,6 +126,8 @@ public:
return base::get_allocator().getNameFor(static_cast<const base &>(*this));
}
+ using base::value_type;
+
using base::at;
using base::begin;
using base::cbegin;