Brenta Engine 1.2
Loading...
Searching...
No Matches
dir_light_ecs_component.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/renderer/renderer.hpp>
11#include <brenta/ecs/ecs.hpp>
12
13#include <tenno/memory.hpp>
14
15namespace brenta
16{
17
18class DirLightEcsComponent : public viotecs::Component
19{
20public:
21
22 tenno::shared_ptr<DirLight> light = nullptr;
23
24 DirLightEcsComponent() = default;
25 DirLightEcsComponent(tenno::shared_ptr<DirLight> l)
26 {
27 this->light = l;
28 }
29 template<typename U>
30 DirLightEcsComponent(tenno::shared_ptr<U> l)
31 {
32 this->light = l;
33 }
34
35 inline void draw()
36 {
37 Renderer::submit_dir_light(this->light);
38 }
39
40};
41
42} // namespace brenta
43
44#endif // BRENTA_NO_ECS