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