...
This commit is contained in:
36
include/opengl/data_managers/buffer_manager.hpp
Normal file
36
include/opengl/data_managers/buffer_manager.hpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#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;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user