~ubuntu-branches/ubuntu/maverick/blender/maverick

« back to all changes in this revision

Viewing changes to source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h

  • Committer: Bazaar Package Importer
  • Author(s): Khashayar Naderehvandi, Khashayar Naderehvandi, Alessio Treglia
  • Date: 2009-01-22 16:53:59 UTC
  • mfrom: (14.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090122165359-v0996tn7fbit64ni
Tags: 2.48a+dfsg-1ubuntu1
[ Khashayar Naderehvandi ]
* Merge from debian experimental (LP: #320045), Ubuntu remaining changes:
  - Add patch correcting header file locations.
  - Add libvorbis-dev and libgsm1-dev to Build-Depends.
  - Use avcodec_decode_audio2() in source/blender/src/hddaudio.c

[ Alessio Treglia ]
* Add missing previous changelog entries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * $Id: RAS_OpenGLRasterizer.h 14444 2008-04-16 22:40:48Z hos $
 
2
 * $Id: RAS_OpenGLRasterizer.h 16510 2008-09-14 00:32:18Z blendix $
3
3
 *
4
4
 * ***** BEGIN GPL LICENSE BLOCK *****
5
5
 *
41
41
#include "RAS_MaterialBucket.h"
42
42
#include "RAS_ICanvas.h"
43
43
 
44
 
#define RAS_MAX 3// match in BL_Material
 
44
#define RAS_MAX_TEXCO   8       // match in BL_Material
 
45
#define RAS_MAX_ATTRIB  16      // match in BL_BlenderShader
45
46
 
46
47
struct  OglDebugLine
47
48
{
76
77
        float                   m_ambb;
77
78
 
78
79
        double                  m_time;
79
 
        MT_CmMatrix4x4  m_viewmatrix;
 
80
        MT_Matrix4x4    m_viewmatrix;
 
81
        MT_Matrix4x4    m_viewinvmatrix;
80
82
        MT_Point3               m_campos;
81
83
 
82
84
        StereoMode              m_stereomode;
86
88
        float                   m_focallength;
87
89
        bool                    m_setfocallength;
88
90
        int                             m_noOfScanlines;
89
 
        bool                    InterlacedStereo() const;
90
91
 
91
92
        //motion blur
92
93
        int     m_motionblur;
94
95
 
95
96
protected:
96
97
        int                             m_drawingmode;
97
 
        TexCoGen                m_texco[RAS_MAX];
98
 
        bool                    m_useTang;
 
98
        TexCoGen                m_texco[RAS_MAX_TEXCO];
 
99
        TexCoGen                m_attrib[RAS_MAX_ATTRIB];
 
100
        int                             m_texco_num;
 
101
        int                             m_attrib_num;
 
102
        int                             m_last_blendmode;
 
103
        bool                    m_last_frontface;
99
104
 
100
105
        /** Stores the caching information for the last material activated. */
101
106
        RAS_IPolyMaterial::TCachingInfo m_materialCachingInfo;
125
130
        virtual bool    Init();
126
131
        virtual void    Exit();
127
132
        virtual bool    BeginFrame(int drawingmode, double time);
 
133
        virtual void    ClearColorBuffer();
128
134
        virtual void    ClearDepthBuffer();
129
135
        virtual void    ClearCachingInfo(void);
130
136
        virtual void    EndFrame();
132
138
 
133
139
        virtual void    SetStereoMode(const StereoMode stereomode);
134
140
        virtual bool    Stereo();
 
141
        virtual bool    InterlacedStereo();
135
142
        virtual void    SetEye(const StereoEye eye);
136
143
        virtual StereoEye       GetEye();
137
144
        virtual void    SetEyeSeparation(const float eyeseparation);
139
146
        virtual void    SetFocalLength(const float focallength);
140
147
        virtual float   GetFocalLength();
141
148
 
142
 
        virtual void    SetAlphaTest(bool enable);
143
 
 
144
149
        virtual void    SwapBuffers();
145
 
        virtual void    IndexPrimitives(
146
 
                                                const vecVertexArray& vertexarrays,
147
 
                                                const vecIndexArrays & indexarrays,
148
 
                                                int mode,
149
 
                                                class RAS_IPolyMaterial* polymat,
150
 
                                                class RAS_IRenderTools* rendertools,
151
 
                                                bool useObjectColor,
152
 
                                                const MT_Vector4& rgbacolor,
153
 
                                                class KX_ListSlot** slot
154
 
                                        );
155
 
 
156
 
        virtual void    IndexPrimitives_Ex(
157
 
                                                const vecVertexArray& vertexarrays,
158
 
                                                const vecIndexArrays & indexarrays,
159
 
                                                int mode,
160
 
                                                class RAS_IPolyMaterial* polymat,
161
 
                                                class RAS_IRenderTools* rendertools,
162
 
                                                bool useObjectColor,
163
 
                                                const MT_Vector4& rgbacolor
164
 
                                        );
165
 
 
 
150
 
 
151
        virtual void    IndexPrimitives(class RAS_MeshSlot& ms);
 
152
        virtual void    IndexPrimitivesMulti(class RAS_MeshSlot& ms);
166
153
        virtual void    IndexPrimitives_3DText(
167
 
                                                const vecVertexArray& vertexarrays,
168
 
                                                const vecIndexArrays & indexarrays,
169
 
                                                int mode,
170
 
                                                class RAS_IPolyMaterial* polymat,
171
 
                                                class RAS_IRenderTools* rendertools,
172
 
                                                bool useObjectColor,
173
 
                                                const MT_Vector4& rgbacolor
174
 
                                        );
175
 
 
176
 
        virtual void IndexPrimitivesMulti( 
177
 
                                                const vecVertexArray& vertexarrays,
178
 
                                                const vecIndexArrays & indexarrays,
179
 
                                                int mode,
180
 
                                                class RAS_IPolyMaterial* polymat,
181
 
                                                class RAS_IRenderTools* rendertools,
182
 
                                                bool useObjectColor,
183
 
                                                const MT_Vector4& rgbacolor,
184
 
                                                class KX_ListSlot** slot);
185
 
 
186
 
        virtual void IndexPrimitivesMulti_Ex( 
187
 
                                                const vecVertexArray& vertexarrays,
188
 
                                                const vecIndexArrays & indexarrays,
189
 
                                                int mode,
190
 
                                                class RAS_IPolyMaterial* polymat,
191
 
                                                class RAS_IRenderTools* rendertools,
192
 
                                                bool useObjectColor,
193
 
                                                const MT_Vector4& rgbacolor);
194
 
 
 
154
                                                class RAS_MeshSlot& ms,
 
155
                                                class RAS_IPolyMaterial* polymat,
 
156
                                                class RAS_IRenderTools* rendertools);
 
157
 
 
158
        void                    IndexPrimitivesInternal(RAS_MeshSlot& ms, bool multi);
195
159
 
196
160
        virtual void    SetProjectionMatrix(MT_CmMatrix4x4 & mat);
197
161
        virtual void    SetProjectionMatrix(const MT_Matrix4x4 & mat);
203
167
                                        );
204
168
 
205
169
        virtual const   MT_Point3& GetCameraPosition();
206
 
        virtual void    LoadViewMatrix();
207
170
        
208
171
        virtual void    SetFog(
209
172
                                                float start,
235
198
        virtual void    SetDrawingMode(int drawingmode);
236
199
        virtual int             GetDrawingMode();
237
200
 
238
 
        virtual void    EnableTextures(bool enable);
239
201
        virtual void    SetCullFace(bool enable);
240
202
        virtual void    SetLines(bool enable);
241
203
 
246
208
                                                        float top,
247
209
                                                        float frustnear,
248
210
                                                        float frustfar,
 
211
                                                        float focallength,
249
212
                                                        bool perspective
250
213
                                                );
251
214
 
285
248
 
286
249
        std::vector <OglDebugLine>      m_debugLines;
287
250
 
288
 
        virtual void    SetTexCoords(TexCoGen coords,int enabled);
289
 
        virtual void    SetAttrib(int type);
290
 
        void                    TexCoord(const RAS_TexVert &tv, int unit);
291
 
        virtual void    GetViewMatrix(MT_Matrix4x4 &mat) const;
292
 
 
293
 
        void    Tangent(const RAS_TexVert& v1,
294
 
                                        const RAS_TexVert& v2,
295
 
                                        const RAS_TexVert& v3,
296
 
                                        const MT_Vector3 &no);
 
251
        virtual void SetTexCoordNum(int num);
 
252
        virtual void SetAttribNum(int num);
 
253
        virtual void SetTexCoord(TexCoGen coords, int unit);
 
254
        virtual void SetAttrib(TexCoGen coords, int unit);
 
255
 
 
256
        void TexCoord(const RAS_TexVert &tv);
 
257
 
 
258
        const MT_Matrix4x4&     GetViewMatrix() const;
 
259
        const MT_Matrix4x4&     GetViewInvMatrix() const;
297
260
        
298
261
        virtual void    EnableMotionBlur(float motionblurvalue);
299
262
        virtual void    DisableMotionBlur();
300
263
        virtual float   GetMotionBlurValue(){return m_motionblurvalue;};
301
 
        virtual int     GetMotionBlurState(){return m_motionblur;};
302
 
        virtual void SetMotionBlurState(int newstate)
 
264
        virtual int             GetMotionBlurState(){return m_motionblur;};
 
265
        virtual void    SetMotionBlurState(int newstate)
303
266
        {
304
267
                if(newstate<0) 
305
268
                        m_motionblur = 0;
308
271
                else 
309
272
                        m_motionblur = newstate;
310
273
        };
 
274
 
 
275
        virtual void    SetBlendingMode(int blendmode);
 
276
        virtual void    SetFrontFace(bool ccw);
311
277
};
312
278
 
313
279
#endif //__RAS_OPENGLRASTERIZER