7#include "../../../Opengl-Core/include/Core.hpp"
22 void init(
const Shared<ogl::Camera> &mainCamera) { this->mainCamera = mainCamera; }
29 Shared<ogl::Camera>
getCamera()
const {
return this->mainCamera; }
43 void addEntity(Shared<ogl::ShaderProgram> &shader,
const unsigned int &ett);
52 void removeEntity(Shared<ogl::ShaderProgram> &shader,
const unsigned int &ett);
69 std::map<Shared<ogl::ShaderProgram>, std::vector<unsigned int>>
getShaderEntityMap()
const {
return this->m_entities; }
73 void operator=(
const BasicScene &other) =
delete;
82 if (s_pointer ==
nullptr) {
83 Shared<BasicScene> copy(
new BasicScene());
93 std::map<Shared<ogl::ShaderProgram>, std::vector<unsigned int>> m_entities{};
96 Shared<ogl::Camera> mainCamera{};
99 inline static Shared<BasicScene> s_pointer =
nullptr;
102 BasicScene() =
default;
This class is used to manage a scene with meshes that will be rendered. It's implemented using Single...
Definition EcsScene.hpp:13
std::map< Shared< ogl::ShaderProgram >, std::vector< unsigned int > > getShaderEntityMap() const
Returns the scene map with key ogl::ShaderProgram shared pointer and a vector of entity ids (Shared<o...
Definition EcsScene.hpp:69
Shared< ogl::Camera > getCamera() const
Retrieves the world camera shared pointer.
Definition EcsScene.hpp:29
void addEntity(Shared< ogl::ShaderProgram > &shader, const unsigned int &ett)
Adds an entity to the scene that will be rendered using the corresponding shader program.
Definition EcsScene.cpp:5
void removeEntity(Shared< ogl::ShaderProgram > &shader, const unsigned int &ett)
Removes the given entity from the scene with the corresponding shader, to optimize entity search proc...
Definition EcsScene.cpp:12
void init(const Shared< ogl::Camera > &mainCamera)
Initialize the current scene by setting the given world camera.
Definition EcsScene.hpp:22
static Shared< BasicScene > instance()
Retrieves the instance of the BasicScene. If it's not instanced, it will be instanced automatically.
Definition EcsScene.hpp:81