OGRE: OgrePrerequisites.h Source File - OGRE Documentation

# OgrePrerequisites.h

Go to the documentation of this file.

    00001 /*-------------------------------------------------------------------------
    00002 This source file is a part of OGRE
    00003 (Object-oriented Graphics Rendering Engine)
    00004
    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 library is free software; you can redistribute it and/or modify it
    00011 under the terms of the GNU Lesser General Public License (LGPL) as
    00012 published by the Free Software Foundation; either version 2.1 of the
    00013 License, or (at your option) any later version.
    00014
    00015 This library is distributed in the hope that it will be useful, but
    00016 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    00017 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
    00018 License for more details.
    00019
    00020 You should have received a copy of the GNU Lesser General Public License
    00021 along with this library; if not, write to the Free Software Foundation,
    00022 Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA or go to
    00023 http://www.gnu.org/copyleft/lesser.txt
    00024 -------------------------------------------------------------------------*/
    00025 #ifndef __OgrePrerequisites_H__
    00026 #define __OgrePrerequisites_H__
    00027
    00028 // Platform-specific stuff
    00029 #include "OgrePlatform.h"
    00030
    00031 // Needed for OGRE_WCHAR_T_STRINGS below
    00032 #include <string>
    00033
    00034 #if OGRE_COMPILER == OGRE_COMPILER_MSVC
    00035 // Turn off warnings generated by long std templates
    00036 // This warns about truncation to 255 characters in debug/browse info
    00037 #   pragma warning (disable : 4786)
    00038
    00039 // Turn off warnings generated by long std templates
    00040 // This warns about truncation to 255 characters in debug/browse info
    00041 #   pragma warning (disable : 4503)
    00042
    00043 // disable: "conversion from 'double' to 'float', possible loss of data
    00044 #   pragma warning (disable : 4244)
    00045
    00046 // disable: "truncation from 'double' to 'float'
    00047 #   pragma warning (disable : 4305)
    00048
    00049 // disable: "<type> needs to have dll-interface to be used by clients'
    00050 // Happens on STL member variables which are not public therefore is ok
    00051 #   pragma warning (disable : 4251)
    00052
    00053 // disable: "non dll-interface class used as base for dll-interface class"
    00054 // Happens when deriving from Singleton because bug in compiler ignores
    00055 // template export
    00056 #   pragma warning (disable : 4275)
    00057
    00058 // disable: "C++ Exception Specification ignored"
    00059 // This is because MSVC 6 did not implement all the C++ exception
    00060 // specifications in the ANSI C++ draft.
    00061 #   pragma warning( disable : 4290 )
    00062
    00063 // disable: "no suitable definition provided for explicit template
    00064 // instantiation request" Occurs in VC7 for no justifiable reason on all
    00065 // #includes of Singleton
    00066 #   pragma warning( disable: 4661)
    00067
    00068 // disable: deprecation warnings when using CRT calls in VC8
    00069 // These show up on all C runtime lib code in VC8, disable since they clutter
    00070 // the warnings with things we may not be able to do anything about (e.g.
    00071 // generated code from nvparse etc). I doubt very much that these calls
    00072 // will ever be actually removed from VC anyway, it would break too much code.
    00073 #   pragma warning( disable: 4996)
    00074
    00075 // disable: "conditional expression constant", always occurs on
    00076 // OGRE_MUTEX_CONDITIONAL when no threading enabled
    00077 #   pragma warning (disable : 201)
    00078
    00079 #endif
    00080
    00081 // configure memory tracking
    00082 #if OGRE_DEBUG_MODE
    00083 #   if OGRE_MEMORY_TRACKER_DEBUG_MODE
    00084 #       define OGRE_MEMORY_TRACKER 1
    00085 #   else
    00086 #       define OGRE_MEMORY_TRACKER 0
    00087 #   endif
    00088 #else
    00089 #   if OGRE_MEMORY_TRACKER_RELEASE_MODE
    00090 #       define OGRE_MEMORY_TRACKER 1
    00091 #   else
    00092 #       define OGRE_MEMORY_TRACKER 0
    00093 #   endif
    00094 #endif
    00095
    00096
    00097
    00098
    00099 namespace Ogre {
    00100     // Define ogre version
    00101     #define OGRE_VERSION_MAJOR 1
    00102     #define OGRE_VERSION_MINOR 6
    00103     #define OGRE_VERSION_PATCH 3
    00104     #define OGRE_VERSION_SUFFIX ""
    00105     #define OGRE_VERSION_NAME "Shoggoth"
    00106
    00107     #define OGRE_VERSION    ((OGRE_VERSION_MAJOR << 16) | (OGRE_VERSION_MINOR << 8) | OGRE_VERSION_PATCH)
    00108
    00109     // define the real number values to be used
    00110     // default to use 'float' unless precompiler option set
    00111     #if OGRE_DOUBLE_PRECISION == 1
    00112
    00115         typedef double Real;
    00116     #else
    00117
    00120         typedef float Real;
    00121     #endif
    00122
    00123     #if OGRE_COMPILER == OGRE_COMPILER_GNUC && OGRE_COMP_VER >= 310 && !defined(STLPORT)
    00124     #   if OGRE_COMP_VER >= 430
    00125     #       define HashMap ::std::tr1::unordered_map
    00126     #       define HashSet ::std::tr1::unordered_set
    00127     #    else
    00128     #       define HashMap ::__gnu_cxx::hash_map
    00129     #       define HashSet ::__gnu_cxx::hash_set
    00130     #    endif
    00131     #else
    00132     #   if OGRE_COMPILER == OGRE_COMPILER_MSVC
    00133     #       if OGRE_COMP_VER >= 1600 // VC++ 10.0
    00134     #           define HashMap ::std::tr1::unordered_map
    00135     #           define HashSet ::std::tr1::unordered_set
    00136     #       elif OGRE_COMP_VER > 1300 && !defined(_STLP_MSVC)
    00137     #           define HashMap ::stdext::hash_map
    00138     #           define HashSet ::stdext::hash_set
    00139     #       else
    00140     #           define HashMap ::std::hash_map
    00141     #           define HashSet ::std::hash_set
    00142     #       endif
    00143     #   else
    00144     #       define HashMap ::std::hash_map
    00145     #       define HashSet ::std::hash_set
    00146     #   endif
    00147     #endif
    00148
    00151     typedef unsigned char uchar;
    00152     typedef unsigned short ushort;
    00153     typedef unsigned int uint;
    00154     typedef unsigned long ulong;
    00155
    00156     #if OGRE_WCHAR_T_STRINGS
    00157         typedef std::wstring _StringBase;
    00158     #else
    00159         typedef std::string _StringBase;
    00160     #endif
    00161
    00162     typedef _StringBase String;
    00163
    00164     // Useful threading defines
    00165     #define OGRE_AUTO_MUTEX_NAME mutex
    00166     #if OGRE_THREAD_SUPPORT
    00167         #define OGRE_AUTO_MUTEX mutable boost::recursive_mutex OGRE_AUTO_MUTEX_NAME;
    00168         #define OGRE_LOCK_AUTO_MUTEX boost::recursive_mutex::scoped_lock ogreAutoMutexLock(OGRE_AUTO_MUTEX_NAME);
    00169         #define OGRE_MUTEX(name) mutable boost::recursive_mutex name;
    00170         #define OGRE_STATIC_MUTEX(name) static boost::recursive_mutex name;
    00171         #define OGRE_STATIC_MUTEX_INSTANCE(name) boost::recursive_mutex name;
    00172         #define OGRE_LOCK_MUTEX(name) boost::recursive_mutex::scoped_lock ogrenameLock(name);
    00173         #define OGRE_LOCK_MUTEX_NAMED(mutexName, lockName) boost::recursive_mutex::scoped_lock lockName(mutexName);
    00174         // like OGRE_AUTO_MUTEX but mutex held by pointer
    00175         #define OGRE_AUTO_SHARED_MUTEX mutable boost::recursive_mutex *OGRE_AUTO_MUTEX_NAME;
    00176         #define OGRE_LOCK_AUTO_SHARED_MUTEX assert(OGRE_AUTO_MUTEX_NAME); boost::recursive_mutex::scoped_lock ogreAutoMutexLock(*OGRE_AUTO_MUTEX_NAME);
    00177         #define OGRE_NEW_AUTO_SHARED_MUTEX assert(!OGRE_AUTO_MUTEX_NAME); OGRE_AUTO_MUTEX_NAME = new boost::recursive_mutex();
    00178         #define OGRE_DELETE_AUTO_SHARED_MUTEX assert(OGRE_AUTO_MUTEX_NAME); delete OGRE_AUTO_MUTEX_NAME;
    00179         #define OGRE_COPY_AUTO_SHARED_MUTEX(from) assert(!OGRE_AUTO_MUTEX_NAME); OGRE_AUTO_MUTEX_NAME = from;
    00180         #define OGRE_SET_AUTO_SHARED_MUTEX_NULL OGRE_AUTO_MUTEX_NAME = 0;
    00181         #define OGRE_MUTEX_CONDITIONAL(mutex) if (mutex)
    00182         #define OGRE_THREAD_SYNCHRONISER(sync) boost::condition sync;
    00183         #define OGRE_THREAD_WAIT(sync, lock) sync.wait(lock);
    00184         #define OGRE_THREAD_NOTIFY_ONE(sync) sync.notify_one();
    00185         #define OGRE_THREAD_NOTIFY_ALL(sync) sync.notify_all();
    00186         // Thread-local pointer
    00187         #define OGRE_THREAD_POINTER(T, var) boost::thread_specific_ptr<T> var
    00188         #define OGRE_THREAD_POINTER_SET(var, expr) var.reset(expr)
    00189         #define OGRE_THREAD_POINTER_DELETE(var) var.reset(0)
    00190         #define OGRE_THREAD_POINTER_GET(var) var.get()
    00191     #else
    00192         #define OGRE_AUTO_MUTEX
    00193         #define OGRE_LOCK_AUTO_MUTEX
    00194         #define OGRE_MUTEX(name)
    00195         #define OGRE_STATIC_MUTEX(name)
    00196         #define OGRE_STATIC_MUTEX_INSTANCE(name)
    00197         #define OGRE_LOCK_MUTEX(name)
    00198         #define OGRE_LOCK_MUTEX_NAMED(mutexName, lockName)
    00199         #define OGRE_AUTO_SHARED_MUTEX
    00200         #define OGRE_LOCK_AUTO_SHARED_MUTEX
    00201         #define OGRE_NEW_AUTO_SHARED_MUTEX
    00202         #define OGRE_DELETE_AUTO_SHARED_MUTEX
    00203         #define OGRE_COPY_AUTO_SHARED_MUTEX(from)
    00204         #define OGRE_SET_AUTO_SHARED_MUTEX_NULL
    00205         #define OGRE_MUTEX_CONDITIONAL(name) if(true)
    00206         #define OGRE_THREAD_SYNCHRONISER(sync)
    00207         #define OGRE_THREAD_WAIT(sync, lock)
    00208         #define OGRE_THREAD_NOTIFY_ONE(sync)
    00209         #define OGRE_THREAD_NOTIFY_ALL(sync)
    00210         #define OGRE_THREAD_POINTER(T, var) T* var
    00211         #define OGRE_THREAD_POINTER_SET(var, expr) var = expr
    00212         #define OGRE_THREAD_POINTER_DELETE(var) OGRE_DELETE var; var = 0
    00213         #define OGRE_THREAD_POINTER_GET(var) var
    00214     #endif
    00215
    00216
    00217 // Pre-declare classes
    00218 // Allows use of pointers in header files without including individual .h
    00219 // so decreases dependencies between files
    00220     class Angle;
    00221     class Animation;
    00222     class AnimationState;
    00223     class AnimationStateSet;
    00224     class AnimationTrack;
    00225     class Archive;
    00226     class ArchiveFactory;
    00227     class ArchiveManager;
    00228     class AutoParamDataSource;
    00229     class AxisAlignedBox;
    00230     class AxisAlignedBoxSceneQuery;
    00231     class Billboard;
    00232     class BillboardChain;
    00233     class BillboardSet;
    00234     class Bone;
    00235     class Camera;
    00236     class Codec;
    00237     class ColourValue;
    00238     class ConfigDialog;
    00239     template <typename T> class Controller;
    00240     template <typename T> class ControllerFunction;
    00241     class ControllerManager;
    00242     template <typename T> class ControllerValue;
    00243     class Degree;
    00244     class DynLib;
    00245     class DynLibManager;
    00246     class EdgeData;
    00247     class EdgeListBuilder;
    00248     class Entity;
    00249     class ErrorDialog;
    00250     class ExternalTextureSourceManager;
    00251     class Factory;
    00252     class Font;
    00253     class FontPtr;
    00254     class FontManager;
    00255     struct FrameEvent;
    00256     class FrameListener;
    00257     class Frustum;
    00258     class GpuProgram;
    00259     class GpuProgramPtr;
    00260     class GpuProgramManager;
    00261     class GpuProgramUsage;
    00262     class HardwareIndexBuffer;
    00263     class HardwareOcclusionQuery;
    00264     class HardwareVertexBuffer;
    00265     class HardwarePixelBuffer;
    00266     class HardwarePixelBufferSharedPtr;
    00267     class HighLevelGpuProgram;
    00268     class HighLevelGpuProgramPtr;
    00269     class HighLevelGpuProgramManager;
    00270     class HighLevelGpuProgramFactory;
    00271     class IndexData;
    00272     class IntersectionSceneQuery;
    00273     class IntersectionSceneQueryListener;
    00274     class Image;
    00275     class KeyFrame;
    00276     class Light;
    00277     class Log;
    00278     class LogManager;
    00279     class ManualResourceLoader;
    00280     class ManualObject;
    00281     class Material;
    00282     class MaterialPtr;
    00283     class MaterialManager;
    00284     class Math;
    00285     class Matrix3;
    00286     class Matrix4;
    00287     class MemoryManager;
    00288     class Mesh;
    00289     class MeshPtr;
    00290     class MeshSerializer;
    00291     class MeshSerializerImpl;
    00292     class MeshManager;
    00293     class MovableObject;
    00294     class MovablePlane;
    00295     class Node;
    00296     class NodeAnimationTrack;
    00297     class NodeKeyFrame;
    00298     class NumericAnimationTrack;
    00299     class NumericKeyFrame;
    00300     class Overlay;
    00301     class OverlayContainer;
    00302     class OverlayElement;
    00303     class OverlayElementFactory;
    00304     class OverlayManager;
    00305     class Particle;
    00306     class ParticleAffector;
    00307     class ParticleAffectorFactory;
    00308     class ParticleEmitter;
    00309     class ParticleEmitterFactory;
    00310     class ParticleSystem;
    00311     class ParticleSystemManager;
    00312     class ParticleSystemRenderer;
    00313     class ParticleSystemRendererFactory;
    00314     class ParticleVisualData;
    00315     class Pass;
    00316     class PatchMesh;
    00317     class PixelBox;
    00318     class Plane;
    00319     class PlaneBoundedVolume;
    00320     class Plugin;
    00321     class Pose;
    00322     class ProgressiveMesh;
    00323     class Profile;
    00324     class Profiler;
    00325     class Quaternion;
    00326     class Radian;
    00327     class Ray;
    00328     class RaySceneQuery;
    00329     class RaySceneQueryListener;
    00330     class Renderable;
    00331     class RenderPriorityGroup;
    00332     class RenderQueue;
    00333     class RenderQueueGroup;
    00334     class RenderQueueInvocation;
    00335     class RenderQueueInvocationSequence;
    00336     class RenderQueueListener;
    00337     class RenderSystem;
    00338     class RenderSystemCapabilities;
    00339     class RenderSystemCapabilitiesManager;
    00340     class RenderSystemCapabilitiesSerializer;
    00341     class RenderTarget;
    00342     class RenderTargetListener;
    00343     class RenderTexture;
    00344     class MultiRenderTarget;
    00345     class RenderWindow;
    00346     class RenderOperation;
    00347     class Resource;
    00348     class ResourceBackgroundQueue;
    00349     class ResourceGroupManager;
    00350     class ResourceManager;
    00351     class RibbonTrail;
    00352     class Root;
    00353     class SceneManager;
    00354     class SceneManagerEnumerator;
    00355     class SceneNode;
    00356     class SceneQuery;
    00357     class SceneQueryListener;
    00358     class ScriptCompiler;
    00359     class ScriptCompilerManager;
    00360     class ScriptLoader;
    00361     class Serializer;
    00362     class ShadowCaster;
    00363     class ShadowRenderable;
    00364     class ShadowTextureManager;
    00365     class SimpleRenderable;
    00366     class SimpleSpline;
    00367     class Skeleton;
    00368     class SkeletonPtr;
    00369     class SkeletonInstance;
    00370     class SkeletonManager;
    00371     class Sphere;
    00372     class SphereSceneQuery;
    00373     class StaticGeometry;
    00374     class StringConverter;
    00375     class StringInterface;
    00376     class SubEntity;
    00377     class SubMesh;
    00378     class TagPoint;
    00379     class Technique;
    00380     class TempBlendedBufferInfo;
    00381     class ExternalTextureSource;
    00382     class TextureUnitState;
    00383     class Texture;
    00384     class TexturePtr;
    00385     class TextureManager;
    00386     class TransformKeyFrame;
    00387     class Timer;
    00388     class UserDefinedObject;
    00389     class Vector2;
    00390     class Vector3;
    00391     class Vector4;
    00392     class Viewport;
    00393     class VertexAnimationTrack;
    00394     class VertexBufferBinding;
    00395     class VertexData;
    00396     class VertexDeclaration;
    00397     class VertexMorphKeyFrame;
    00398     class WireBoundingBox;
    00399     class Compositor;
    00400     class CompositorManager;
    00401     class CompositorChain;
    00402     class CompositorInstance;
    00403     class CompositionTechnique;
    00404     class CompositionPass;
    00405     class CompositionTargetPass;
    00406 }
    00407
    00408 /* Include all the standard header *after* all the configuration
    00409 settings have been made.
    00410 */
    00411 #include "OgreStdHeaders.h"
    00412 #include "OgreMemoryAllocatorConfig.h"
    00413
    00414
    00415 #endif // __OgrePrerequisites_H__
    00416
    00417

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Jul 26 11:32:19 2009