From 7644b740e87053838f3c7a80e88ad192fcf1a5e2 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sat, 21 Oct 2017 13:50:04 -0400 Subject: lightsgit status! fireflies --- include/systems/light.hpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 include/systems/light.hpp (limited to 'include/systems/light.hpp') diff --git a/include/systems/light.hpp b/include/systems/light.hpp new file mode 100644 index 0000000..71c541a --- /dev/null +++ b/include/systems/light.hpp @@ -0,0 +1,34 @@ +#ifndef SYSTEM_LIGHT_HPP_ +#define SYSTEM_LIGHT_HPP_ + +#include +#include +#include + +#include +#include + +struct Light { + vec2 pos; + float radius; + Color color; + + Light(vec2 p = vec2(), float r = 0, Color c = Color()) + : pos(p), radius(r), color(c) {} +}; + +class LightSystem : public entityx::System { +private: + static std::vector lights; + +public: + void update(entityx::EntityManager& en, entityx::EventManager& ev, entityx::TimeDelta dt) override; + + static void render(void); + + static int addLight(vec2 pos, float radius, Color color = Color(1, 1, 1)); + static void updateLight(int index, vec2 pos, float radius = -1); + static void removeLight(int index); +}; + +#endif // SYSTEM_LIGHT_HPP_ -- cgit v1.2.3