Files
Z3D/include/opengl/data_managers/buffer_manager.hpp
2025-03-23 21:11:22 +01:00

37 lines
739 B
C++

#pragma once
namespace zgl
{
class buffer_manager
{
public:
using store_type = dynamic_texture_store;
using store_id_type = store_type::id_type;
using resource_manager_type = resource_manager<store_id_type>;
using resource_type = resource_manager_type::resource_handle;
using handle_type = texture_handle;
static constexpr std::size_t min_garbage_collection_count = 4;
void process(store_type& store);
std::optional<handle_type> get_handle(store_id_type id);
void collect_garbage(bool force = false);
private:
resource_manager<store_id_type> m_resource_manager;
std::vector<std::pair<dynamic_texture_store::id_type, const dynamic_texture_buffer&>> m_texture_buffer;
std::vector<GLuint> m_texture_id_buffer;
};
}