Brenta Engine
1.2
Loading...
Searching...
No Matches
point_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
15
namespace
brenta
16
{
17
18
class
PointLightEcsComponent
:
public
viotecs::Component
19
{
20
public
:
21
22
tenno::shared_ptr<PointLight> light =
nullptr
;
23
24
PointLightEcsComponent
() =
default
;
25
PointLightEcsComponent
(tenno::shared_ptr<PointLight> l)
26
{
27
this->light = l;
28
}
29
30
inline
void
draw(
const
Transform
& t)
31
{
32
auto
& pos = this->light->position;
33
pos = t.get_pos();
34
Renderer::submit_point_light(this->light);
35
}
36
37
};
38
39
}
// namespace brenta
40
41
#endif
// BRENTA_NO_ECS
brenta::PointLightEcsComponent
Definition
point_light_ecs_component.hpp:19
brenta::Transform
Definition
transform.hpp:15
include
brenta
ecs
components
point_light_ecs_component.hpp
Generated by
1.9.8