36 lines
767 B
C++
36 lines
767 B
C++
#pragma once
|
|
|
|
#include "resource_manager.hpp"
|
|
|
|
namespace zgl
|
|
{
|
|
|
|
class resource_handle
|
|
{
|
|
public:
|
|
using id_type = reference_counter::gl_id_type;
|
|
|
|
resource_handle() = default;
|
|
|
|
inline resource_handle(id_type id, reference_counter* manager);
|
|
|
|
resource_handle(const resource_handle& other) = delete;
|
|
resource_handle& operator=(const resource_handle& other) = delete;
|
|
|
|
inline resource_handle(resource_handle&& other) noexcept;
|
|
inline resource_handle& operator=(resource_handle&& other) noexcept;
|
|
|
|
inline ~resource_handle();
|
|
|
|
protected:
|
|
id_type m_id{ 0 };
|
|
|
|
private:
|
|
reference_counter* m_counter{ nullptr };
|
|
};
|
|
|
|
}
|
|
|
|
#define INCLUDE_RESOURCE_HANDLE_IMPLEMENTATION
|
|
#include "opengl/resource_management/resource_handle.ipp"
|
|
#undef INCLUDE_RESOURCE_HANDLE_IMPLEMENTATION |