2 #include <msp/strings/format.h>
3 #include "directionallight.h"
5 #include "pointlight.h"
17 void Light::set_color(const Color &c)
23 void Light::update_shader_data(ProgramData &shdata, unsigned i) const
25 update_shader_data(shdata, format("light_sources[%d]", i));
28 Light::GenericLoader::TypeRegistry &Light::get_light_registry()
30 static GenericLoader::TypeRegistry registry;
31 static bool initialized = false;
35 registry.register_type<DirectionalLight>("directional");
36 registry.register_type<PointLight>("point");
42 Light::Loader::Loader(Light &l):
43 DataFile::ObjectLoader<Light>(l)
46 void Light::Loader::init_actions()
48 add("color", &Loader::color);
51 void Light::Loader::color(float r, float g, float b)
53 obj.set_color(Color(r, g, b));