Initial revision
[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 /**
43 BlenderRenderTools are a set of tools to apply 2D/3D graphics effects, which are not
44 part of the (polygon) Rasterizer. 
45 Effects like 2D text, 3D (polygon) text, lighting.
46 */
47
48 class KX_BlenderRenderTools  : public RAS_IRenderTools
49 {
50         bool    m_lastblenderlights;
51         void*   m_lastblenderobject;
52         int             m_lastlayer;
53         bool    m_lastlighting;
54
55 public:
56         
57                                                 KX_BlenderRenderTools();
58         virtual                         ~KX_BlenderRenderTools();       
59
60         virtual void            EndFrame(class RAS_IRasterizer* rasty);
61         virtual void            BeginFrame(class RAS_IRasterizer* rasty);
62         void                            DisableOpenGLLights();
63         void                            EnableOpenGLLights();
64         int                                     ProcessLighting(int layer);
65
66         virtual void        RenderText2D(RAS_TEXT_RENDER_MODE mode,
67                                                                          const char* text,
68                                                                          int xco,
69                                                                          int yco,
70                                                                          int width,
71                                                                          int height);
72         virtual void            RenderText(int mode,
73                                                                    class RAS_IPolyMaterial* polymat,
74                                                                    float v1[3],
75                                                                    float v2[3],
76                                                                    float v3[3],
77                                                                    float v4[3]);
78         void                            applyTransform(class RAS_IRasterizer* rasty,
79                                                                            double* oglmatrix,
80                                                                            int objectdrawmode );
81         int                                     applyLights(int objectlayer);
82         virtual void            PushMatrix();
83         virtual void            PopMatrix();
84
85         virtual class RAS_IPolyMaterial* CreateBlenderPolyMaterial(const STR_String &texname,
86                                                                                                                            bool ba,
87                                                                                                                            const STR_String& matname,
88                                                                                                                            int tile,
89                                                                                                                            int tilexrep,
90                                                                                                                            int tileyrep,
91                                                                                                                            int mode,
92                                                                                                                            int transparant,
93                                                                                                                            int lightlayer,
94                                                                                                                            bool bIsTriangle,
95                                                                                                                            void* clientobject,
96                                                                                                                            void* tface);
97 };
98
99
100 #endif //__KX_BLENDERRENDERTOOLS