From c89a633f59d0e393695c10f28c4ba8635eadffba Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 7 Mar 2026 11:42:46 +0000 Subject: Replace glContainer with glAllocator glContainer is no longer required, as we can use std::vector with a custom allocator which uses OpenGL buffers for storage. Minor irritation is that the mapped buffers aren't guaranteed to be flushed in the tests, so sometimes we're missing bits in a test render. --- game/network/rail.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'game/network/rail.cpp') diff --git a/game/network/rail.cpp b/game/network/rail.cpp index 8d85f35..545620d 100644 --- a/game/network/rail.cpp +++ b/game/network/rail.cpp @@ -140,8 +140,7 @@ template<> NetworkLinkHolder::NetworkLinkHolder() { vao.configure() .addAttribs( - 0, vertices.bufferName()); + &RailLinkStraight::Vertex::rotation, &RailLinkStraight::Vertex::textureRepeats>(0); } template<> NetworkLinkHolder::NetworkLinkHolder() @@ -149,7 +148,7 @@ template<> NetworkLinkHolder::NetworkLinkHolder() vao.configure() .addAttribs(0, vertices.bufferName()); + &RailLinkCurve::Vertex::bangle, &RailLinkCurve::Vertex::radius>(0); } namespace { @@ -160,6 +159,8 @@ namespace { if (auto count = networkLinks.vertices.size()) { shader.use(RAIL_CROSS_SECTION, RAIL_TEXTURE_POS); glBindVertexArray(networkLinks.vao); + glVertexArrayVertexBuffer( + networkLinks.vao, 0, networkLinks.vertices.bufferName(), 0, sizeof(typename LinkType::Vertex)); glDrawArrays(mode, 0, static_cast(count)); } }; -- cgit v1.3