Merge of first part of changes from the apricot branch, especially
[blender.git] / source / gameengine / Ketsji / BL_BlenderShader.h
1
2 #ifndef __BL_GPUSHADER_H__
3 #define __BL_GPUSHADER_H__
4
5 #include "GPU_material.h"
6
7 #include "MT_Matrix4x4.h"
8 #include "MT_Matrix3x3.h"
9 #include "MT_Tuple2.h"
10 #include "MT_Tuple3.h"
11 #include "MT_Tuple4.h"
12
13 #include "RAS_IPolygonMaterial.h"
14
15 #include "KX_Scene.h"
16
17 struct Material;
18 struct Scene;
19 class BL_Material;
20
21 #define BL_MAX_ATTRIB   16
22
23 /**
24  * BL_BlenderShader
25  *  Blender GPU shader material
26  */
27 class BL_BlenderShader
28 {
29 private:
30         KX_Scene                *mScene;
31         struct Scene    *mBlenderScene;
32         struct Material *mMat;
33         int                             mLightLayer;
34         int                             mBlendMode;
35
36         bool                    VerifyShader();
37
38 public:
39         BL_BlenderShader(KX_Scene *scene, struct Material *ma, int lightlayer);
40         virtual ~BL_BlenderShader();
41
42         bool                            Ok();
43         void                            SetProg(bool enable, double time=0.0);
44
45         int GetAttribNum();
46         void SetAttribs(class RAS_IRasterizer* ras, const BL_Material *mat);
47         void Update(const class RAS_MeshSlot & ms, class RAS_IRasterizer* rasty);
48         int GetBlendMode();
49
50         bool Equals(BL_BlenderShader *blshader);
51 };
52
53 #endif//__BL_GPUSHADER_H__