Brenta Engine 1.2
Loading...
Searching...
No Matches
point_light_render_system.hpp
1// SPDX-License-Identifier: MIT
2// Author: Giovanni Santini
3// Mail: giovanni.santini@proton.me
4// Github: @San7o
5
6#pragma once
7
8#ifndef BRENTA_NO_ECS
9
10#include <brenta/ecs/ecs.hpp>
11#include <brenta/ecs/components/transform_ecs_component.hpp>
12#include <brenta/ecs/components/point_light_ecs_component.hpp>
13
14#include <vector>
15
16namespace brenta
17{
18
19class PointLightRenderSystem : public viotecs::System<PointLightEcsComponent,
20 TransformEcsComponent>
21{
22public:
23
24 void run(std::vector<viotecs::EntityId> entities) const override
25 {
26 for (auto& e : entities)
27 {
28 auto transform =
29 viotecs::World::entity_to_component<TransformEcsComponent>(e);
30 auto point_light =
31 viotecs::World::entity_to_component<PointLightEcsComponent>(e);
32 point_light->draw(transform->transform);
33 }
34 }
35};
36
37} // namespace brenta
38
39#endif // BRENTA_NO_ECS