00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OGRE 00004 (Object-oriented Graphics Rendering Engine) 00005 For the latest info, see http://www.ogre3d.org/ 00006 00007 Copyright (c) 2000-2005 The OGRE Team 00008 Also see acknowledgements in Readme.html 00009 00010 This program is free software; you can redistribute it and/or modify it under 00011 the terms of the GNU Lesser General Public License as published by the Free Software 00012 Foundation; either version 2 of the License, or (at your option) any later 00013 version. 00014 00015 This program is distributed in the hope that it will be useful, but WITHOUT 00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public License along with 00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00022 http://www.gnu.org/copyleft/lesser.txt. 00023 ----------------------------------------------------------------------------- 00024 */ 00025 #ifndef __Common_H__ 00026 #define __Common_H__ 00027 // Common stuff 00028 00029 #include <utility> 00030 00031 namespace Ogre { 00032 00033 00036 enum CompareFunction 00037 { 00038 CMPF_ALWAYS_FAIL, 00039 CMPF_ALWAYS_PASS, 00040 CMPF_LESS, 00041 CMPF_LESS_EQUAL, 00042 CMPF_EQUAL, 00043 CMPF_NOT_EQUAL, 00044 CMPF_GREATER_EQUAL, 00045 CMPF_GREATER 00046 }; 00047 00050 enum TextureFilterOptions 00051 { 00053 TFO_NONE, 00055 TFO_BILINEAR, 00057 TFO_TRILINEAR, 00059 TFO_ANISOTROPIC 00060 }; 00061 00062 enum FilterType 00063 { 00065 FT_MIN, 00067 FT_MAG, 00069 FT_MIP 00070 }; 00072 enum FilterOptions 00073 { 00075 FO_NONE, 00077 FO_POINT, 00079 FO_LINEAR, 00081 FO_ANISOTROPIC 00082 }; 00083 00085 enum ShadeOptions 00086 { 00087 SO_FLAT, 00088 SO_GOURAUD, 00089 SO_PHONG 00090 }; 00091 00093 enum FogMode 00094 { 00096 FOG_NONE, 00098 FOG_EXP, 00100 FOG_EXP2, 00102 FOG_LINEAR 00103 }; 00104 00107 enum CullingMode 00108 { 00110 CULL_NONE = 1, 00112 CULL_CLOCKWISE = 2, 00114 CULL_ANTICLOCKWISE = 3 00115 }; 00116 00122 enum ManualCullingMode 00123 { 00125 MANUAL_CULL_NONE = 1, 00127 MANUAL_CULL_BACK = 2, 00129 MANUAL_CULL_FRONT = 3 00130 }; 00131 00133 enum WaveformType 00134 { 00136 WFT_SINE, 00138 WFT_TRIANGLE, 00140 WFT_SQUARE, 00142 WFT_SAWTOOTH, 00144 WFT_INVERSE_SAWTOOTH, 00147 WFT_PWM 00148 }; 00149 00151 enum PolygonMode 00152 { 00154 PM_POINTS = 1, 00156 PM_WIREFRAME = 2, 00158 PM_SOLID = 3 00159 }; 00160 00162 enum ShadowTechnique 00163 { 00165 SHADOWTYPE_NONE = 0x00, 00168 SHADOWDETAILTYPE_ADDITIVE = 0x01, 00171 SHADOWDETAILTYPE_MODULATIVE = 0x02, 00174 SHADOWDETAILTYPE_STENCIL = 0x10, 00177 SHADOWDETAILTYPE_TEXTURE = 0x20, 00178 00185 SHADOWTYPE_STENCIL_MODULATIVE = 0x12, 00193 SHADOWTYPE_STENCIL_ADDITIVE = 0x11, 00198 SHADOWTYPE_TEXTURE_MODULATIVE = 0x22, 00199 00208 SHADOWTYPE_TEXTURE_ADDITIVE = 0x21, 00209 }; 00210 00212 typedef int TrackVertexColourType; 00213 enum TrackVertexColourEnum { 00214 TVC_NONE = 0x0, 00215 TVC_AMBIENT = 0x1, 00216 TVC_DIFFUSE = 0x2, 00217 TVC_SPECULAR = 0x4, 00218 TVC_EMISSIVE = 0x8 00219 }; 00220 00222 enum SortMode 00223 { 00225 SM_DIRECTION, 00227 SM_DISTANCE 00228 }; 00229 00231 enum FrameBufferType { 00232 FBT_COLOUR = 0x1, 00233 FBT_DEPTH = 0x2, 00234 FBT_STENCIL = 0x4 00235 }; 00236 00237 00238 typedef std::vector<Light*> LightList; 00239 00240 typedef std::map<String, bool> UnaryOptionList; 00241 typedef std::map<String, String> BinaryOptionList; 00242 00244 typedef std::map<String, String> NameValuePairList; 00245 00247 typedef std::map<String, String> AliasTextureNamePairList; 00248 00249 template< typename T > struct TRect 00250 { 00251 T left, top, right, bottom; 00252 TRect() {} 00253 TRect( T const & l, T const & t, T const & r, T const & b ) 00254 : left( l ), top( t ), right( r ), bottom( b ) 00255 { 00256 } 00257 TRect( TRect const & o ) 00258 : left( o.left ), top( o.top ), right( o.right ), bottom( o.bottom ) 00259 { 00260 } 00261 TRect & operator=( TRect const & o ) 00262 { 00263 left = o.left; 00264 top = o.top; 00265 right = o.right; 00266 bottom = o.bottom; 00267 return *this; 00268 } 00269 T width() const 00270 { 00271 return right - left; 00272 } 00273 T height() const 00274 { 00275 return bottom - top; 00276 } 00277 }; 00278 00281 typedef TRect<float> FloatRect; 00282 00285 typedef TRect< long > Rect; 00286 00291 struct Box 00292 { 00293 size_t left, top, right, bottom, front, back; 00295 Box() 00296 { 00297 } 00307 Box( size_t l, size_t t, size_t r, size_t b ): 00308 left(l), 00309 top(t), 00310 right(r), 00311 bottom(b), 00312 front(0), 00313 back(1) 00314 { 00315 assert(right >= left && bottom >= top && back >= front); 00316 } 00328 Box( size_t l, size_t t, size_t ff, size_t r, size_t b, size_t bb ): 00329 left(l), 00330 top(t), 00331 right(r), 00332 bottom(b), 00333 front(ff), 00334 back(bb) 00335 { 00336 assert(right >= left && bottom >= top && back >= front); 00337 } 00338 00340 bool contains(const Box &def) const 00341 { 00342 return (def.left >= left && def.top >= top && def.front >= front && 00343 def.right <= right && def.bottom <= bottom && def.back <= back); 00344 } 00345 00347 size_t getWidth() const { return right-left; } 00349 size_t getHeight() const { return bottom-top; } 00351 size_t getDepth() const { return back-front; } 00352 }; 00353 00354 00355 00367 int _OgreExport findCommandLineOpts(int numargs, char** argv, UnaryOptionList& unaryOptList, 00368 BinaryOptionList& binOptList); 00369 00370 } 00371 00372 #endif
Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:37:38 2006