- assigning vectors in the BGE wasn't updating the vector from the callback
[blender.git] / source / gameengine / Ketsji / KX_Light.h
index 236d3e4e12e434c1ba2090b66a6711d1397a8501..0b7ccbe81abcebdf5359e297eb7af56dbbe035f6 100644 (file)
 #include "RAS_LightObject.h"
 #include "KX_GameObject.h"
 
+struct GPULamp;
+struct Scene;
+class KX_Camera;
+class RAS_IRasterizer;
+class RAS_IRenderTools;
+class MT_Transform;
+
 class KX_LightObject : public KX_GameObject
 {
        Py_Header;
 protected:
        RAS_LightObject         m_lightobj;
        class RAS_IRenderTools* m_rendertools;  //needed for registering and replication of lightobj
-       static char             doc[];
+       bool                            m_glsl;
+       Scene*                          m_blenderscene;
 
 public:
-       KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks,class RAS_IRenderTools* rendertools,const struct RAS_LightObject& lightobj, PyTypeObject *T = &Type);
+       KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks,class RAS_IRenderTools* rendertools,const struct RAS_LightObject& lightobj, bool glsl);
        virtual ~KX_LightObject();
        virtual CValue*         GetReplica();
        RAS_LightObject*        GetLightData() { return &m_lightobj;}
-       
-       virtual PyObject* _getattr(const STR_String& attr); /* lens, near, far, projection_matrix */
-       virtual int       _setattr(const STR_String& attr, PyObject *pyvalue);
+
+       /* OpenGL Light */
+       bool ApplyLight(KX_Scene *kxscene, int oblayer, int slot);
+
+       /* GLSL Light */
+       struct GPULamp *GetGPULamp();
+       bool HasShadowBuffer();
+       int GetShadowLayer();
+       void BindShadowBuffer(class RAS_IRasterizer *ras, class KX_Camera *cam, class MT_Transform& camtrans);
+       void UnbindShadowBuffer(class RAS_IRasterizer *ras);
+       void Update();
+
+       /* attributes */
+       static PyObject*        pyattr_get_color(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+       static int                      pyattr_set_color(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value);
+       static PyObject*        pyattr_get_typeconst(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+       static PyObject*        pyattr_get_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+       static int                      pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value);
+
+       virtual bool IsLight(void) { return true; }
 };
 
 #endif //__KX_LIGHT