From a6e28fe377b41500d6ce3e0a9a4d6e6288d97f61 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 17 Jan 2024 01:08:54 +0000 Subject: Copy render vital link data to vertex buffer --- game/network/network.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'game/network/network.h') diff --git a/game/network/network.h b/game/network/network.h index fa311ac..12c006c 100644 --- a/game/network/network.h +++ b/game/network/network.h @@ -1,5 +1,6 @@ #pragma once +#include "gfx/gl/instanceVertices.h" #include "link.h" #include #include @@ -58,7 +59,13 @@ protected: std::shared_ptr texture; }; -template class NetworkOf : public Network, public Renderable { +template class NetworkLinkHolder { + friend LinkType; + mutable InstanceVertices vertices; +}; + +template +class NetworkOf : public Network, public Renderable, public NetworkLinkHolder... { protected: using Network::Network; @@ -75,7 +82,7 @@ public: requires std::is_base_of_v { const auto node1 = candidateNodeAt(a).first, node2 = candidateNodeAt(b).first; - return std::make_shared(node1, node2, std::forward(params)...); + return std::make_shared(*this, node1, node2, std::forward(params)...); } template @@ -84,7 +91,7 @@ public: requires std::is_base_of_v { const auto node1 = nodeAt(a), node2 = nodeAt(b); - auto l {links.template create(node1, node2, std::forward(params)...)}; + auto l {links.template create(*this, node1, node2, std::forward(params)...)}; joinLinks(l); return l; } -- cgit v1.2.3