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