X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flighting.h;h=7c7dc454c14f027e1fed3c17f62ec5b6b9b3c608;hb=61ff840cd211f10d45dca8c4dad2cca5f68aaa42;hp=85d5fb0406c877cb0d89e855cc6d6cff2b90a384;hpb=efe80f5a696b4a3be2378dc6d635c89676afa12d;p=libs%2Fgl.git diff --git a/source/lighting.h b/source/lighting.h index 85d5fb04..7c7dc454 100644 --- a/source/lighting.h +++ b/source/lighting.h @@ -1,37 +1,26 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2008 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_GL_LIGHTING_H_ #define MSP_GL_LIGHTING_H_ #include +#include "bindable.h" #include "color.h" #include "gl.h" +#include "programdata.h" namespace Msp { namespace GL { class Light; -enum -{ - LIGHTING = GL_LIGHTING -}; - /** Encapsulates global lighting parameters and a number of individual lights. */ -class Lighting +class Lighting: public Bindable { private: Color ambient; std::vector lights; - - static const Lighting *current; + ProgramData shdata; public: Lighting(); @@ -41,6 +30,9 @@ public: void attach(unsigned, const Light &); void detach(unsigned); + + void update_shader_data(const Matrix &); + const ProgramData &get_shader_data() const { return shdata; } void bind() const; static void unbind();