#include #include #include #include "client/render/loader/GLLoader.h" namespace td { namespace render { class VertexCache { typedef std::vector Vector; struct DataIndex { Vector position; Vector color; }; private: std::size_t m_VertexCount; std::unordered_map m_Indexes; std::unique_ptr m_VertexArray; public: VertexCache() : m_VertexCount(0) {} void AddData(std::uint64_t index, std::vector positions, std::vector colors); void RemoveData(std::uint64_t index); void Clear(); void UpdateVertexArray(); const GL::VertexArray& GetVertexArray() const { return *m_VertexArray; } bool IsEmpty() const { return m_VertexArray == nullptr; } }; } // namespace render } // namespace td