#pragma once #include "assets/data_stores.hpp" #include "assets/data_stores/mesh_store.hpp" #include "opengl/resource_management/resource_manager.hpp" #include "opengl/handles/index_buffer_handle.hpp" #include "opengl/metadata/index_buffer_metadata.hpp" namespace zgl { class mesh_index_buffer_manager { public: using store_type = assets::mesh_store; using store_id_type = store_type::id_type; using metadata_type = index_buffer_metadata; using handle_type = index_buffer_handle; using resource_manager_type = resource_manager; using entry_type = std::pair; static constexpr std::size_t min_garbage_collection_count = 4; void process(const store_type& meshes); std::optional get_handle(store_id_type id); void collect_garbage(bool force = false); protected: resource_manager_type m_resource_manager; private: std::vector m_mesh_buffer; std::vector m_buffer_id_buffer; }; }