kaliber/src/engine/renderer/render_resource.h

31 lines
627 B
C++

#ifndef ENGINE_RENDERER_RENDER_RESOURCE_H
#define ENGINE_RENDERER_RENDER_RESOURCE_H
#include <cstdint>
namespace eng {
class Renderer;
class RenderResource {
public:
RenderResource(Renderer* renderer) : renderer_(renderer){};
bool IsValid() const { return resource_id_ != 0; }
uint64_t resource_id() { return resource_id_; }
protected:
uint64_t resource_id_ = 0;
Renderer* renderer_ = nullptr;
~RenderResource() = default;
RenderResource(const RenderResource&) = delete;
RenderResource& operator=(const RenderResource&) = delete;
};
} // namespace eng
#endif // ENGINE_RENDERER_RENDER_RESOURCE_H