SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
ResourceBase.hpp
Go to the documentation of this file.
1#ifndef _RESOURCEBASE_HPP_
2#define _RESOURCEBASE_HPP_
3
4#include <Core/OSDef.hpp>
5#include <string>
6
7namespace Sleak {
8
9/// Common lifecycle contract for GPU-backed resources: init, per-frame update, teardown.
10class ENGINE_API ResourceBase {
11 public:
12 virtual ~ResourceBase() = default;
13 /// Allocates backend resources from backend-specific creation parameters.
14 virtual bool Initialize(void* Data) = 0;
15 virtual void Update() = 0;
16 virtual void Cleanup() = 0;
17 protected:
18 std::string Name;
20};
21
22}
23
24#endif
Common lifecycle contract for GPU-backed resources: init, per-frame update, teardown.
virtual void Update()=0
virtual void Cleanup()=0
virtual ~ResourceBase()=default
virtual bool Initialize(void *Data)=0
Allocates backend resources from backend-specific creation parameters.
Root namespace for everything the engine exposes.
Definition Camera.hpp:10