Files
HydraV3/HydraEngine/source/ecs/systems/HydraLightSystem.cpp
T
2026-08-18 16:23:20 +01:00

42 lines
1.2 KiB
C++

#include "HydraLightSystem.h"
#include "../../engine/HydraEngine.h"
#include "../HydraECS.h"
#include "../components/HydraLightComponent.h"
#include "../components/HydraPositionComponent.h"
#include "../../buffer/HydraLightBufferManager.h"
#include "../../scheduler/HydraTaskScheduler.h"
#include "../../task/buffer/HydraCreateGPUBufferTask.hpp"
#include "../../task/buffer/HydraDeleteGPUBufferTask.hpp"
#include "../../task/buffer/HydraUpdatePartialGPUBufferTask.hpp"
#include "../../actor/HydraActorManager.h"
#include <GLMIncludes.h>
void HydraLightSystem::Initialise()
{
}
void HydraLightSystem::InitialiseComponent(HydraID entity_id)
{
HydraLightBufferManager *light_man = GetEngine()->LightBufferManager();
HydraECS *ecs = GetEngine()->ECS();
HydraLightComponent &light_comp = ecs->GetComponent<HydraLightComponent>(entity_id);
light_man->AddLight(light_comp);
}
void HydraLightSystem::DestroyComponent(HydraID actor_id)
{
HydraLightBufferManager *light_man = GetEngine()->LightBufferManager();
light_man->RemoveLight(actor_id);
}
void HydraLightSystem::UpdateSystem(float delta_t_seconds)
{
HydraLightBufferManager *light_man = GetEngine()->LightBufferManager();
light_man->UpdateBuffer();
}