soc-2008-mxcurioni: merge with trunk - rev 15540
[blender.git] / source / gameengine / Ketsji / BL_BlenderShader.h
1
2 #ifndef __BL_GPUSHADER_H__
3 #define __BL_GPUSHADER_H__
4
5 #ifdef BLENDER_GLSL
6 #include "GPU_material.h"
7 #endif
8
9 #include "MT_Matrix4x4.h"
10 #include "MT_Matrix3x3.h"
11 #include "MT_Tuple2.h"
12 #include "MT_Tuple3.h"
13 #include "MT_Tuple4.h"
14
15 #include "RAS_IPolygonMaterial.h"
16
17 struct Material;
18 class BL_Material;
19
20 #define BL_MAX_ATTRIB   16
21
22 /**
23  * BL_BlenderShader
24  *  Blender GPU shader material
25  */
26 class BL_BlenderShader
27 {
28 private:
29 #ifdef BLENDER_GLSL
30         GPUMaterial             *mGPUMat;
31 #endif
32         bool                    mBound;
33         int                             mLightLayer;
34
35 public:
36         BL_BlenderShader(struct Material *ma, int lightlayer);
37         virtual ~BL_BlenderShader();
38
39         const bool                      Ok()const;
40         void                            SetProg(bool enable);
41
42         int GetAttribNum();
43         void SetAttribs(class RAS_IRasterizer* ras, const BL_Material *mat);
44         void Update(const class KX_MeshSlot & ms, class RAS_IRasterizer* rasty);
45
46         bool Equals(BL_BlenderShader *blshader);
47 };
48
49 #endif//__BL_GPUSHADER_H__