ECS with entt
This commit is contained in:
33
open_engine/include/open_engine/scene/scene.hpp
Normal file
33
open_engine/include/open_engine/scene/scene.hpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef SCENE_HPP
|
||||
#define SCENE_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include <entt/entt.hpp>
|
||||
|
||||
namespace OpenEngine {
|
||||
|
||||
class Entity;
|
||||
|
||||
class Scene
|
||||
{
|
||||
public:
|
||||
Scene() {};
|
||||
~Scene() = default;
|
||||
|
||||
Entity CreateEntity(const std::string& name = std::string());
|
||||
|
||||
void OnUpdate();
|
||||
void OnViewportResize(uint32_t width, uint32_t height);
|
||||
|
||||
entt::registry& GetRegistry() { return registry; };
|
||||
|
||||
private:
|
||||
entt::registry registry;
|
||||
|
||||
uint32_t viewport_width = 0, viewport_height = 0;
|
||||
|
||||
friend class Entity;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // SCENE_HPP
|
||||
Reference in New Issue
Block a user