From 66ba8d76cf83e0e1875f13749833d95cb831f4b9 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 14 Feb 2026 12:37:53 +0000 Subject: Return indices instead of iterates from InstanceVertices::partition More useful in the context of passing them to OpenGL. --- gfx/gl/instanceVertices.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gfx') diff --git a/gfx/gl/instanceVertices.h b/gfx/gl/instanceVertices.h index 28e11ee..629c664 100644 --- a/gfx/gl/instanceVertices.h +++ b/gfx/gl/instanceVertices.h @@ -127,16 +127,22 @@ public: } template - glContainer::iterator + base::size_type partition(Pred pred) { - return partition(base::begin(), base::end(), pred); + return indexOf(partition(base::begin(), base::end(), pred)); } protected: static constexpr auto npos = static_cast(-1); friend InstanceProxy; + base::size_type + indexOf(base::iterator iter) + { + return static_cast(iter - base::begin()); + } + void release(const size_t pidx) { -- cgit v1.3