resolved conflict state with HEAD r14096
[blender.git] / source / gameengine / BlenderRoutines / KX_BlenderRenderTools.h
1 /**
2  * $Id$
3  *
4  * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version. The Blender
10  * Foundation also sells licenses for use in proprietary software under
11  * the Blender License.  See http://www.blender.org/BL/ for information
12  * about this.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software Foundation,
21  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22  *
23  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
24  * All rights reserved.
25  *
26  * The Original Code is: all of this file.
27  *
28  * Contributor(s): none yet.
29  *
30  * ***** END GPL/BL DUAL LICENSE BLOCK *****
31  */
32 #ifndef __KX_BLENDERRENDERTOOLS
33 #define __KX_BLENDERRENDERTOOLS
34
35 #ifdef WIN32
36 // don't show stl-warnings
37 #pragma warning (disable:4786)
38 #endif
39
40 #include "RAS_IRenderTools.h"
41
42 struct KX_ClientObjectInfo;
43
44 /**
45 BlenderRenderTools are a set of tools to apply 2D/3D graphics effects, which are not
46 part of the (polygon) Rasterizer. 
47 Effects like 2D text, 3D (polygon) text, lighting.
48 */
49
50 class KX_BlenderRenderTools  : public RAS_IRenderTools
51 {
52         bool    m_lastblenderlights;
53         void*   m_lastblenderobject;
54         int             m_lastlayer;
55         bool    m_lastlighting;
56         static unsigned int m_numgllights;
57         
58         
59 public:
60         
61                                                 KX_BlenderRenderTools();
62         virtual                         ~KX_BlenderRenderTools();       
63
64         virtual void            EndFrame(class RAS_IRasterizer* rasty);
65         virtual void            BeginFrame(class RAS_IRasterizer* rasty);
66         void                            DisableOpenGLLights();
67         void                            EnableOpenGLLights();
68         int                                     ProcessLighting(int layer);
69
70         virtual void        RenderText2D(RAS_TEXT_RENDER_MODE mode,
71                                                                          const char* text,
72                                                                          int xco,
73                                                                          int yco,
74                                                                          int width,
75                                                                          int height);
76         virtual void            RenderText(int mode,
77                                                                    class RAS_IPolyMaterial* polymat,
78                                                                    float v1[3],
79                                                                    float v2[3],
80                                                                    float v3[3],
81                                                                    float v4[3]);
82         void                            applyTransform(class RAS_IRasterizer* rasty,
83                                                                            double* oglmatrix,
84                                                                            int objectdrawmode );
85         int                                     applyLights(int objectlayer);
86         virtual void            PushMatrix();
87         virtual void            PopMatrix();
88
89         virtual class RAS_IPolyMaterial* CreateBlenderPolyMaterial(const STR_String &texname,
90                                                                         bool ba,
91                                                                         const STR_String& matname,
92                                                                         int tile,
93                                                                         int tilexrep,
94                                                                         int tileyrep,
95                                                                         int mode,
96                                                                         bool transparant,
97                                                                         bool zsort,
98                                                                         int lightlayer,
99                                                                         bool bIsTriangle,
100                                                                         void* clientobject,
101                                                                         void* tface);
102         
103         bool RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data);
104
105         virtual void MotionBlur(RAS_IRasterizer* rasterizer);
106
107         virtual void Update2DFilter(RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode, int pass, STR_String& text);
108
109         virtual void Render2DFilters(RAS_ICanvas* canvas);
110
111 };
112
113 #endif //__KX_BLENDERRENDERTOOLS
114
115
116