NLA SoC: Merge from 2.5 - 21179 to 21209
[blender.git] / source / gameengine / Ketsji / BL_BlenderShader.h
index 4cab0e644c36441ad63d36aa1b5aa725073c5f39..9af53bfc86323f3996ca8898ac00b6aa1608ea97 100644 (file)
@@ -2,9 +2,7 @@
 #ifndef __BL_GPUSHADER_H__
 #define __BL_GPUSHADER_H__
 
-#if 0
 #include "GPU_material.h"
-#endif
 
 #include "MT_Matrix4x4.h"
 #include "MT_Matrix3x3.h"
 #include "MT_Tuple3.h"
 #include "MT_Tuple4.h"
 
+#include "RAS_IPolygonMaterial.h"
+
+#include "KX_Scene.h"
+
 struct Material;
+struct Scene;
+class BL_Material;
 
 #define BL_MAX_ATTRIB  16
 
@@ -23,22 +27,36 @@ struct Material;
 class BL_BlenderShader
 {
 private:
-#if 0
-       GPUMaterial             *mGPUMat;
-#endif
-       bool                    mBound;
+       KX_Scene                *mScene;
+       struct Scene    *mBlenderScene;
+       struct Material *mMat;
+       int                             mLightLayer;
+       int                             mBlendMode;
+       GPUMaterial     *mGPUMat;
+
+       bool                    VerifyShader() 
+       {
+               return (NULL != mGPUMat);
+       }
 
 public:
-       BL_BlenderShader(struct Material *ma);
+       BL_BlenderShader(KX_Scene *scene, struct Material *ma, int lightlayer);
        virtual ~BL_BlenderShader();
 
-       const bool                      Ok()const;
-       void                            SetProg(bool enable);
+       bool                            Ok()
+       {
+               // same as VerifyShared
+               return (NULL != mGPUMat);
+       }
+       void                            SetProg(bool enable, double time=0.0);
 
-       void ApplyShader();
-       void SetTexCoords(class RAS_IRasterizer* ras);
        int GetAttribNum();
-       void Update(const class KX_MeshSlot & ms, class RAS_IRasterizer* rasty);
+       void SetAttribs(class RAS_IRasterizer* ras, const BL_Material *mat);
+       void Update(const class RAS_MeshSlot & ms, class RAS_IRasterizer* rasty);
+       void ReloadMaterial();
+       int GetBlendMode();
+
+       bool Equals(BL_BlenderShader *blshader);
 };
 
 #endif//__BL_GPUSHADER_H__