|
Blender
V2.59
|
00001 /* 00002 * $Id: RAS_IRenderTools.h 35072 2011-02-22 12:42:55Z jesterking $ 00003 * 00004 * ***** BEGIN GPL LICENSE BLOCK ***** 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software Foundation, 00018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 * 00020 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00021 * All rights reserved. 00022 * 00023 * The Original Code is: all of this file. 00024 * 00025 * Contributor(s): none yet. 00026 * 00027 * ***** END GPL LICENSE BLOCK ***** 00028 */ 00029 00034 #ifndef __RAS_IRENDERTOOLS 00035 #define __RAS_IRENDERTOOLS 00036 00037 #include "MT_Transform.h" 00038 #include "RAS_IRasterizer.h" 00039 #include "RAS_2DFilterManager.h" 00040 00041 #include <vector> 00042 #include <algorithm> 00043 00044 #ifdef WITH_CXX_GUARDEDALLOC 00045 #include "MEM_guardedalloc.h" 00046 #endif 00047 00048 class RAS_IPolyMaterial; 00049 struct RAS_LightObject; 00050 00051 00052 class RAS_IRenderTools 00053 { 00054 00055 protected: 00056 void* m_clientobject; 00057 void* m_auxilaryClientInfo; 00058 00059 std::vector<struct RAS_LightObject*> m_lights; 00060 00061 RAS_2DFilterManager m_filtermanager; 00062 00063 public: 00064 enum RAS_TEXT_RENDER_MODE { 00065 RAS_TEXT_RENDER_NODEF = 0, 00066 RAS_TEXT_NORMAL, 00067 RAS_TEXT_PADDED, 00068 RAS_TEXT_MAX 00069 }; 00070 00071 RAS_IRenderTools( 00072 ) : 00073 m_clientobject(NULL) 00074 { 00075 }; 00076 00077 virtual 00078 ~RAS_IRenderTools( 00079 ) {}; 00080 00081 virtual 00082 void 00083 BeginFrame( 00084 RAS_IRasterizer* rasty 00085 )=0; 00086 00087 virtual 00088 void 00089 EndFrame( 00090 RAS_IRasterizer* rasty 00091 )=0; 00092 00093 // the following function was formerly called 'Render' 00094 // by it doesn't render anymore 00095 // It only sets the transform for the rasterizer 00096 // so must be renamed to 'applyTransform' or something 00097 00098 virtual 00099 void 00100 applyTransform( 00101 class RAS_IRasterizer* rasty, 00102 double* oglmatrix, 00103 int drawingmode 00104 )=0; 00105 00116 virtual 00117 void 00118 RenderText3D(int fontid, 00119 const char* text, 00120 int size, 00121 int dpi, 00122 float* color, 00123 double* mat, 00124 float aspect 00125 ) = 0; 00126 00127 00137 virtual 00138 void 00139 RenderText2D( 00140 RAS_TEXT_RENDER_MODE mode, 00141 const char* text, 00142 int xco, 00143 int yco, 00144 int width, 00145 int height 00146 ) = 0; 00147 00148 // 3d text, mapped on polygon 00149 virtual 00150 void 00151 RenderText( 00152 int mode, 00153 RAS_IPolyMaterial* polymat, 00154 float v1[3], 00155 float v2[3], 00156 float v3[3], 00157 float v4[3], 00158 int glattrib 00159 )=0; 00160 00161 virtual 00162 void 00163 ProcessLighting( 00164 RAS_IRasterizer *rasty, 00165 bool uselights, 00166 const MT_Transform& trans 00167 )=0; 00168 00169 virtual 00170 void 00171 SetClientObject( 00172 RAS_IRasterizer* rasty, 00173 void* obj 00174 ); 00175 00176 void 00177 SetAuxilaryClientInfo( 00178 void* inf 00179 ); 00180 00181 virtual 00182 void 00183 PushMatrix( 00184 )=0; 00185 00186 virtual 00187 void 00188 PopMatrix( 00189 )=0; 00190 00191 virtual 00192 void 00193 AddLight( 00194 struct RAS_LightObject* lightobject 00195 ); 00196 00197 virtual 00198 void 00199 RemoveLight( 00200 struct RAS_LightObject* lightobject 00201 ); 00202 00203 virtual 00204 void 00205 MotionBlur(RAS_IRasterizer* rasterizer)=0; 00206 00207 00208 #ifdef WITH_CXX_GUARDEDALLOC 00209 public: 00210 void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IRenderTools"); } 00211 void operator delete( void *mem ) { MEM_freeN(mem); } 00212 #endif 00213 }; 00214 00215 #endif //__RAS_IRENDERTOOLS 00216 00217 00218