OgreCommon.h

Go to the documentation of this file.
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-2006 Torus Knot Software Ltd
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 You may alternatively use this source under the terms of a specific version of
00025 the OGRE Unrestricted License provided you have obtained such a license from
00026 Torus Knot Software Ltd.
00027 -----------------------------------------------------------------------------
00028 */
00029 #ifndef __Common_H__
00030 #define __Common_H__
00031 // Common stuff
00032 
00033 #include "OgreString.h"
00034 
00035 #if defined ( OGRE_GCC_VISIBILITY )
00036 #   pragma GCC visibility push(default)
00037 #endif
00038 
00039 #include <utility>
00040 #include <vector>
00041 #include <map>
00042 
00043 #if defined ( OGRE_GCC_VISIBILITY )
00044 #   pragma GCC visibility pop
00045 #endif
00046 
00047 namespace Ogre {
00048 
00049 
00052     enum CompareFunction
00053     {
00054         CMPF_ALWAYS_FAIL,
00055         CMPF_ALWAYS_PASS,
00056         CMPF_LESS,
00057         CMPF_LESS_EQUAL,
00058         CMPF_EQUAL,
00059         CMPF_NOT_EQUAL,
00060         CMPF_GREATER_EQUAL,
00061         CMPF_GREATER
00062     };
00063 
00066     enum TextureFilterOptions
00067     {
00069         TFO_NONE,
00071         TFO_BILINEAR,
00073         TFO_TRILINEAR,
00075         TFO_ANISOTROPIC
00076     };
00077 
00078     enum FilterType
00079     {
00081         FT_MIN,
00083         FT_MAG,
00085         FT_MIP
00086     };
00088     enum FilterOptions
00089     {
00091         FO_NONE,
00093         FO_POINT,
00095         FO_LINEAR,
00097         FO_ANISOTROPIC
00098     };
00099 
00101     enum ShadeOptions
00102     {
00103         SO_FLAT,
00104         SO_GOURAUD,
00105         SO_PHONG
00106     };
00107 
00109     enum FogMode
00110     {
00112         FOG_NONE,
00114         FOG_EXP,
00116         FOG_EXP2,
00118         FOG_LINEAR
00119     };
00120 
00123     enum CullingMode
00124     {
00126         CULL_NONE = 1,
00128         CULL_CLOCKWISE = 2,
00130         CULL_ANTICLOCKWISE = 3
00131     };
00132 
00138     enum ManualCullingMode
00139     {
00141         MANUAL_CULL_NONE = 1,
00143         MANUAL_CULL_BACK = 2,
00145         MANUAL_CULL_FRONT = 3
00146     };
00147 
00149     enum WaveformType
00150     {
00152         WFT_SINE,
00154         WFT_TRIANGLE,
00156         WFT_SQUARE,
00158         WFT_SAWTOOTH,
00160         WFT_INVERSE_SAWTOOTH,
00163         WFT_PWM
00164     };
00165 
00167     enum PolygonMode
00168     {
00170         PM_POINTS = 1,
00172         PM_WIREFRAME = 2,
00174         PM_SOLID = 3
00175     };
00176 
00178     enum ShadowTechnique
00179     {
00181         SHADOWTYPE_NONE = 0x00,
00184         SHADOWDETAILTYPE_ADDITIVE = 0x01,
00187         SHADOWDETAILTYPE_MODULATIVE = 0x02,
00190         SHADOWDETAILTYPE_INTEGRATED = 0x04,
00193         SHADOWDETAILTYPE_STENCIL = 0x10,
00196         SHADOWDETAILTYPE_TEXTURE = 0x20,
00197         
00204         SHADOWTYPE_STENCIL_MODULATIVE = 0x12,
00212         SHADOWTYPE_STENCIL_ADDITIVE = 0x11,
00217         SHADOWTYPE_TEXTURE_MODULATIVE = 0x22,
00218         
00227         SHADOWTYPE_TEXTURE_ADDITIVE = 0x21,
00228 
00244         SHADOWTYPE_TEXTURE_ADDITIVE_INTEGRATED = 0x25,
00260         SHADOWTYPE_TEXTURE_MODULATIVE_INTEGRATED = 0x26
00261     };
00262 
00264     typedef int TrackVertexColourType;
00265     enum TrackVertexColourEnum {
00266         TVC_NONE        = 0x0,
00267         TVC_AMBIENT     = 0x1,        
00268         TVC_DIFFUSE     = 0x2,
00269         TVC_SPECULAR    = 0x4,
00270         TVC_EMISSIVE    = 0x8
00271     };
00272 
00274     enum SortMode
00275     {
00277         SM_DIRECTION,
00279         SM_DISTANCE
00280     };
00281 
00283     enum FrameBufferType {
00284         FBT_COLOUR  = 0x1,
00285         FBT_DEPTH   = 0x2,
00286         FBT_STENCIL = 0x4
00287     };
00288     
00289     
00290     class Light;
00291     typedef std::vector<Light*> LightList;
00292 
00293     typedef std::map<String, bool> UnaryOptionList;
00294     typedef std::map<String, String> BinaryOptionList;
00295 
00297     typedef std::map<String, String> NameValuePairList;
00298 
00300     typedef std::map<String, String> AliasTextureNamePairList;
00301 
00302         template< typename T > struct TRect
00303         {
00304           T left, top, right, bottom;
00305           TRect() {}
00306           TRect( T const & l, T const & t, T const & r, T const & b )
00307             : left( l ), top( t ), right( r ), bottom( b )
00308           {
00309           }
00310           TRect( TRect const & o )
00311             : left( o.left ), top( o.top ), right( o.right ), bottom( o.bottom )
00312           {
00313           }
00314           TRect & operator=( TRect const & o )
00315           {
00316             left = o.left;
00317             top = o.top;
00318             right = o.right;
00319             bottom = o.bottom;
00320             return *this;
00321           }
00322           T width() const
00323           {
00324             return right - left;
00325           }
00326           T height() const
00327           {
00328             return bottom - top;
00329           }
00330         };
00331 
00334         typedef TRect<float> FloatRect;
00335 
00339         typedef TRect<Real> RealRect;
00340 
00343         typedef TRect< long > Rect;
00344 
00349         struct Box
00350         {
00351             size_t left, top, right, bottom, front, back;
00353             Box()
00354                 : left(0), top(0), right(1), bottom(1), front(0), back(1)
00355             {
00356             }
00366             Box( size_t l, size_t t, size_t r, size_t b ):
00367                 left(l),
00368                 top(t),   
00369                 right(r),
00370                 bottom(b),
00371                 front(0),
00372                 back(1)
00373             {
00374                 assert(right >= left && bottom >= top && back >= front);
00375             }
00387             Box( size_t l, size_t t, size_t ff, size_t r, size_t b, size_t bb ):
00388                 left(l),
00389                 top(t),   
00390                 right(r),
00391                 bottom(b),
00392                 front(ff),
00393                 back(bb)
00394             {
00395                 assert(right >= left && bottom >= top && back >= front);
00396             }
00397             
00399             bool contains(const Box &def) const
00400             {
00401                 return (def.left >= left && def.top >= top && def.front >= front &&
00402                     def.right <= right && def.bottom <= bottom && def.back <= back);
00403             }
00404             
00406             size_t getWidth() const { return right-left; }
00408             size_t getHeight() const { return bottom-top; }
00410             size_t getDepth() const { return back-front; }
00411         };
00412 
00413     
00414     
00426     int _OgreExport findCommandLineOpts(int numargs, char** argv, UnaryOptionList& unaryOptList, 
00427         BinaryOptionList& binOptList);
00428 
00430     enum ClipResult
00431     {
00433         CLIPPED_NONE = 0,
00435         CLIPPED_SOME = 1, 
00437         CLIPPED_ALL = 2
00438     };
00439 }
00440 
00441 #endif

Copyright © 2008 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Sep 27 22:02:22 2009