tried making naming more uniform and implemented most of the opengl managers
This commit is contained in:
35
include/opengl/data_managers/mesh_index_buffer_manager.hpp
Normal file
35
include/opengl/data_managers/mesh_index_buffer_manager.hpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "../../assets/data_stores"
|
||||
#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 = dynamic_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<store_id_type, metadata_type>;
|
||||
using entry_type = std::pair<handle_type, metadata_type>;
|
||||
|
||||
static constexpr std::size_t min_garbage_collection_count = 4;
|
||||
|
||||
void process(store_type& store);
|
||||
|
||||
std::optional<entry_type> get_handle(store_id_type id);
|
||||
|
||||
void collect_garbage(bool force = false);
|
||||
|
||||
protected:
|
||||
resource_manager_type m_resource_manager;
|
||||
|
||||
private:
|
||||
std::vector<store_type::iterator_type::value_type> m_mesh_buffer;
|
||||
std::vector<GLuint> m_buffer_id_buffer;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user