# 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 2
    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 > 1300 && !defined(_STLP_MSVC)
    00134     #           define HashMap ::stdext::hash_map
    00135     #           define HashSet ::stdext::hash_set
    00136     #       else
    00137     #           define HashMap ::std::hash_map
    00138     #           define HashSet ::std::hash_set
    00139     #       endif
    00140     #   else
    00141     #       define HashMap ::std::hash_map
    00142     #       define HashSet ::std::hash_set
    00143     #   endif
    00144     #endif
    00145
    00148     typedef unsigned char uchar;
    00149     typedef unsigned short ushort;
    00150     typedef unsigned int uint;
    00151     typedef unsigned long ulong;
    00152
    00153     #if OGRE_WCHAR_T_STRINGS
    00154         typedef std::wstring _StringBase;
    00155     #else
    00156         typedef std::string _StringBase;
    00157     #endif
    00158
    00159     typedef _StringBase String;
    00160
    00161     // Useful threading defines
    00162     #define OGRE_AUTO_MUTEX_NAME mutex
    00163     #if OGRE_THREAD_SUPPORT
    00164         #define OGRE_AUTO_MUTEX mutable boost::recursive_mutex OGRE_AUTO_MUTEX_NAME;
    00165         #define OGRE_LOCK_AUTO_MUTEX boost::recursive_mutex::scoped_lock ogreAutoMutexLock(OGRE_AUTO_MUTEX_NAME);
    00166         #define OGRE_MUTEX(name) mutable boost::recursive_mutex name;
    00167         #define OGRE_STATIC_MUTEX(name) static boost::recursive_mutex name;
    00168         #define OGRE_STATIC_MUTEX_INSTANCE(name) boost::recursive_mutex name;
    00169         #define OGRE_LOCK_MUTEX(name) boost::recursive_mutex::scoped_lock ogrenameLock(name);
    00170         #define OGRE_LOCK_MUTEX_NAMED(mutexName, lockName) boost::recursive_mutex::scoped_lock lockName(mutexName);
    00171         // like OGRE_AUTO_MUTEX but mutex held by pointer
    00172         #define OGRE_AUTO_SHARED_MUTEX mutable boost::recursive_mutex *OGRE_AUTO_MUTEX_NAME;
    00173         #define OGRE_LOCK_AUTO_SHARED_MUTEX assert(OGRE_AUTO_MUTEX_NAME); boost::recursive_mutex::scoped_lock ogreAutoMutexLock(*OGRE_AUTO_MUTEX_NAME);
    00174         #define OGRE_NEW_AUTO_SHARED_MUTEX assert(!OGRE_AUTO_MUTEX_NAME); OGRE_AUTO_MUTEX_NAME = new boost::recursive_mutex();
    00175         #define OGRE_DELETE_AUTO_SHARED_MUTEX assert(OGRE_AUTO_MUTEX_NAME); delete OGRE_AUTO_MUTEX_NAME;
    00176         #define OGRE_COPY_AUTO_SHARED_MUTEX(from) assert(!OGRE_AUTO_MUTEX_NAME); OGRE_AUTO_MUTEX_NAME = from;
    00177         #define OGRE_SET_AUTO_SHARED_MUTEX_NULL OGRE_AUTO_MUTEX_NAME = 0;
    00178         #define OGRE_MUTEX_CONDITIONAL(mutex) if (mutex)
    00179         #define OGRE_THREAD_SYNCHRONISER(sync) boost::condition sync;
    00180         #define OGRE_THREAD_WAIT(sync, lock) sync.wait(lock);
    00181         #define OGRE_THREAD_NOTIFY_ONE(sync) sync.notify_one();
    00182         #define OGRE_THREAD_NOTIFY_ALL(sync) sync.notify_all();
    00183         // Thread-local pointer
    00184         #define OGRE_THREAD_POINTER(T, var) boost::thread_specific_ptr<T> var
    00185         #define OGRE_THREAD_POINTER_SET(var, expr) var.reset(expr)
    00186         #define OGRE_THREAD_POINTER_DELETE(var) var.reset(0)
    00187         #define OGRE_THREAD_POINTER_GET(var) var.get()
    00188     #else
    00189         #define OGRE_AUTO_MUTEX
    00190         #define OGRE_LOCK_AUTO_MUTEX
    00191         #define OGRE_MUTEX(name)
    00192         #define OGRE_STATIC_MUTEX(name)
    00193         #define OGRE_STATIC_MUTEX_INSTANCE(name)
    00194         #define OGRE_LOCK_MUTEX(name)
    00195         #define OGRE_LOCK_MUTEX_NAMED(mutexName, lockName)
    00196         #define OGRE_AUTO_SHARED_MUTEX
    00197         #define OGRE_LOCK_AUTO_SHARED_MUTEX
    00198         #define OGRE_NEW_AUTO_SHARED_MUTEX
    00199         #define OGRE_DELETE_AUTO_SHARED_MUTEX
    00200         #define OGRE_COPY_AUTO_SHARED_MUTEX(from)
    00201         #define OGRE_SET_AUTO_SHARED_MUTEX_NULL
    00202         #define OGRE_MUTEX_CONDITIONAL(name) if(true)
    00203         #define OGRE_THREAD_SYNCHRONISER(sync)
    00204         #define OGRE_THREAD_WAIT(sync, lock)
    00205         #define OGRE_THREAD_NOTIFY_ONE(sync)
    00206         #define OGRE_THREAD_NOTIFY_ALL(sync)
    00207         #define OGRE_THREAD_POINTER(T, var) T* var
    00208         #define OGRE_THREAD_POINTER_SET(var, expr) var = expr
    00209         #define OGRE_THREAD_POINTER_DELETE(var) OGRE_DELETE var; var = 0
    00210         #define OGRE_THREAD_POINTER_GET(var) var
    00211     #endif
    00212
    00213
    00214 // Pre-declare classes
    00215 // Allows use of pointers in header files without including individual .h
    00216 // so decreases dependencies between files
    00217     class Angle;
    00218     class Animation;
    00219     class AnimationState;
    00220     class AnimationStateSet;
    00221     class AnimationTrack;
    00222     class Archive;
    00223     class ArchiveFactory;
    00224     class ArchiveManager;
    00225     class AutoParamDataSource;
    00226     class AxisAlignedBox;
    00227     class AxisAlignedBoxSceneQuery;
    00228     class Billboard;
    00229     class BillboardChain;
    00230     class BillboardSet;
    00231     class Bone;
    00232     class Camera;
    00233     class Codec;
    00234     class ColourValue;
    00235     class ConfigDialog;
    00236     template <typename T> class Controller;
    00237     template <typename T> class ControllerFunction;
    00238     class ControllerManager;
    00239     template <typename T> class ControllerValue;
    00240     class Degree;
    00241     class DynLib;
    00242     class DynLibManager;
    00243     class EdgeData;
    00244     class EdgeListBuilder;
    00245     class Entity;
    00246     class ErrorDialog;
    00247     class ExternalTextureSourceManager;
    00248     class Factory;
    00249     class Font;
    00250     class FontPtr;
    00251     class FontManager;
    00252     struct FrameEvent;
    00253     class FrameListener;
    00254     class Frustum;
    00255     class GpuProgram;
    00256     class GpuProgramPtr;
    00257     class GpuProgramManager;
    00258     class GpuProgramUsage;
    00259     class HardwareIndexBuffer;
    00260     class HardwareOcclusionQuery;
    00261     class HardwareVertexBuffer;
    00262     class HardwarePixelBuffer;
    00263     class HardwarePixelBufferSharedPtr;
    00264     class HighLevelGpuProgram;
    00265     class HighLevelGpuProgramPtr;
    00266     class HighLevelGpuProgramManager;
    00267     class HighLevelGpuProgramFactory;
    00268     class IndexData;
    00269     class IntersectionSceneQuery;
    00270     class IntersectionSceneQueryListener;
    00271     class Image;
    00272     class KeyFrame;
    00273     class Light;
    00274     class Log;
    00275     class LogManager;
    00276     class ManualResourceLoader;
    00277     class ManualObject;
    00278     class Material;
    00279     class MaterialPtr;
    00280     class MaterialManager;
    00281     class Math;
    00282     class Matrix3;
    00283     class Matrix4;
    00284     class MemoryManager;
    00285     class Mesh;
    00286     class MeshPtr;
    00287     class MeshSerializer;
    00288     class MeshSerializerImpl;
    00289     class MeshManager;
    00290     class MovableObject;
    00291     class MovablePlane;
    00292     class Node;
    00293     class NodeAnimationTrack;
    00294     class NodeKeyFrame;
    00295     class NumericAnimationTrack;
    00296     class NumericKeyFrame;
    00297     class Overlay;
    00298     class OverlayContainer;
    00299     class OverlayElement;
    00300     class OverlayElementFactory;
    00301     class OverlayManager;
    00302     class Particle;
    00303     class ParticleAffector;
    00304     class ParticleAffectorFactory;
    00305     class ParticleEmitter;
    00306     class ParticleEmitterFactory;
    00307     class ParticleSystem;
    00308     class ParticleSystemManager;
    00309     class ParticleSystemRenderer;
    00310     class ParticleSystemRendererFactory;
    00311     class ParticleVisualData;
    00312     class Pass;
    00313     class PatchMesh;
    00314     class PixelBox;
    00315     class Plane;
    00316     class PlaneBoundedVolume;
    00317     class Plugin;
    00318     class Pose;
    00319     class ProgressiveMesh;
    00320     class Profile;
    00321     class Profiler;
    00322     class Quaternion;
    00323     class Radian;
    00324     class Ray;
    00325     class RaySceneQuery;
    00326     class RaySceneQueryListener;
    00327     class Renderable;
    00328     class RenderPriorityGroup;
    00329     class RenderQueue;
    00330     class RenderQueueGroup;
    00331     class RenderQueueInvocation;
    00332     class RenderQueueInvocationSequence;
    00333     class RenderQueueListener;
    00334     class RenderSystem;
    00335     class RenderSystemCapabilities;
    00336     class RenderSystemCapabilitiesManager;
    00337     class RenderSystemCapabilitiesSerializer;
    00338     class RenderTarget;
    00339     class RenderTargetListener;
    00340     class RenderTexture;
    00341     class MultiRenderTarget;
    00342     class RenderWindow;
    00343     class RenderOperation;
    00344     class Resource;
    00345     class ResourceBackgroundQueue;
    00346     class ResourceGroupManager;
    00347     class ResourceManager;
    00348     class RibbonTrail;
    00349     class Root;
    00350     class SceneManager;
    00351     class SceneManagerEnumerator;
    00352     class SceneNode;
    00353     class SceneQuery;
    00354     class SceneQueryListener;
    00355     class ScriptCompiler;
    00356     class ScriptCompilerManager;
    00357     class ScriptLoader;
    00358     class Serializer;
    00359     class ShadowCaster;
    00360     class ShadowRenderable;
    00361     class ShadowTextureManager;
    00362     class SimpleRenderable;
    00363     class SimpleSpline;
    00364     class Skeleton;
    00365     class SkeletonPtr;
    00366     class SkeletonInstance;
    00367     class SkeletonManager;
    00368     class Sphere;
    00369     class SphereSceneQuery;
    00370     class StaticGeometry;
    00371     class StringConverter;
    00372     class StringInterface;
    00373     class SubEntity;
    00374     class SubMesh;
    00375     class TagPoint;
    00376     class Technique;
    00377     class TempBlendedBufferInfo;
    00378     class ExternalTextureSource;
    00379     class TextureUnitState;
    00380     class Texture;
    00381     class TexturePtr;
    00382     class TextureManager;
    00383     class TransformKeyFrame;
    00384     class Timer;
    00385     class UserDefinedObject;
    00386     class Vector2;
    00387     class Vector3;
    00388     class Vector4;
    00389     class Viewport;
    00390     class VertexAnimationTrack;
    00391     class VertexBufferBinding;
    00392     class VertexData;
    00393     class VertexDeclaration;
    00394     class VertexMorphKeyFrame;
    00395     class WireBoundingBox;
    00396     class Compositor;
    00397     class CompositorManager;
    00398     class CompositorChain;
    00399     class CompositorInstance;
    00400     class CompositionTechnique;
    00401     class CompositionPass;
    00402     class CompositionTargetPass;
    00403 }
    00404
    00405 /* Include all the standard header *after* all the configuration
    00406 settings have been made.
    00407 */
    00408 #include "OgreStdHeaders.h"
    00409 #include "OgreMemoryAllocatorConfig.h"
    00410
    00411
    00412 #endif // __OgrePrerequisites_H__
    00413
    00414

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sat Apr 11 13:46:42 2009