Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/forks/sandbox_light/src/external/ogremath/OgrePrerequisites.h @ 9215

Last change on this file since 9215 was 7909, checked in by rgrieder, 14 years ago

Added missing std includes to ogremath and removed boost thread and date_time dependencies.

  • Property svn:eol-style set to native
File size: 13.9 KB
Line 
1/*-------------------------------------------------------------------------
2This source file is a part of OGRE
3(Object-oriented Graphics Rendering Engine)
4
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2006 Torus Knot Software Ltd
8Also see acknowledgements in Readme.html
9
10This library is free software; you can redistribute it and/or modify it
11under the terms of the GNU Lesser General Public License (LGPL) as
12published by the Free Software Foundation; either version 2.1 of the
13License, or (at your option) any later version.
14
15This library is distributed in the hope that it will be useful, but
16WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
18License for more details.
19
20You should have received a copy of the GNU Lesser General Public License
21along with this library; if not, write to the Free Software Foundation,
22Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA or go to
23http://www.gnu.org/copyleft/lesser.txt
24-------------------------------------------------------------------------*/
25#ifndef __OgrePrerequisites_H__
26#define __OgrePrerequisites_H__
27
28// Platform-specific stuff
29#include "OgrePlatform.h"
30
31// Needed for OGRE_WCHAR_T_STRINGS below
32#include <string>
33
34#include <cassert>
35#include <cstdio>
36#include <cstdlib>
37#include <ctime>
38#include <cstring>
39#include <cstdarg>
40#include <cmath>
41
42// STL containers
43#include <vector>
44#include <map>
45#include <string>
46#include <set>
47#include <list>
48#include <deque>
49#include <queue>
50#include <bitset>
51
52// Note - not in the original STL, but exists in SGI STL and STLport
53// For gcc 4.3 see http://gcc.gnu.org/gcc-4.3/changes.html
54#if (OGRE_COMPILER == OGRE_COMPILER_GNUC) && !defined(STLPORT)
55#   if OGRE_COMP_VER >= 430
56#       include <tr1/unordered_map>
57#       include <tr1/unordered_set>
58#   else
59#       include <ext/hash_map>
60#       include <ext/hash_set>
61#   endif
62#else
63#   if (OGRE_COMPILER == OGRE_COMPILER_MSVC) && !defined(STLPORT) && OGRE_COMP_VER >= 1600 // VC++ 10.0
64#       include <unordered_map>
65#       include <unordered_set>
66#       else
67#       include <hash_set>
68#       include <hash_map>
69#       endif
70#endif
71
72// STL algorithms & functions
73#include <algorithm>
74#include <functional>
75#include <limits>
76
77// C++ Stream stuff
78#include <fstream>
79#include <iostream>
80#include <iomanip>
81#include <sstream>
82
83#if OGRE_COMPILER == OGRE_COMPILER_MSVC
84// Turn off warnings generated by long std templates
85// This warns about truncation to 255 characters in debug/browse info
86#   pragma warning (disable : 4786)
87
88// Turn off warnings generated by long std templates
89// This warns about truncation to 255 characters in debug/browse info
90#   pragma warning (disable : 4503)
91
92// disable: "conversion from 'double' to 'float', possible loss of data
93#   pragma warning (disable : 4244)
94
95// disable: "truncation from 'double' to 'float'
96#   pragma warning (disable : 4305)
97
98// disable: "<type> needs to have dll-interface to be used by clients'
99// Happens on STL member variables which are not public therefore is ok
100#   pragma warning (disable : 4251)
101
102// disable: "non dll-interface class used as base for dll-interface class"
103// Happens when deriving from Singleton because bug in compiler ignores
104// template export
105#   pragma warning (disable : 4275)
106
107// disable: "C++ Exception Specification ignored"
108// This is because MSVC 6 did not implement all the C++ exception
109// specifications in the ANSI C++ draft.
110#   pragma warning( disable : 4290 )
111
112// disable: "no suitable definition provided for explicit template
113// instantiation request" Occurs in VC7 for no justifiable reason on all
114// #includes of Singleton
115#   pragma warning( disable: 4661)
116
117// disable: deprecation warnings when using CRT calls in VC8
118// These show up on all C runtime lib code in VC8, disable since they clutter
119// the warnings with things we may not be able to do anything about (e.g.
120// generated code from nvparse etc). I doubt very much that these calls
121// will ever be actually removed from VC anyway, it would break too much code.
122#       pragma warning( disable: 4996)
123
124// disable: "conditional expression constant", always occurs on
125// OGRE_MUTEX_CONDITIONAL when no threading enabled
126#   pragma warning (disable : 201)
127
128#endif
129
130// configure memory tracking
131#if OGRE_DEBUG_MODE
132#       if OGRE_MEMORY_TRACKER_DEBUG_MODE
133#               define OGRE_MEMORY_TRACKER 1
134#       else
135#               define OGRE_MEMORY_TRACKER 0
136#       endif
137#else
138#       if OGRE_MEMORY_TRACKER_RELEASE_MODE
139#               define OGRE_MEMORY_TRACKER 1
140#       else
141#               define OGRE_MEMORY_TRACKER 0
142#       endif
143#endif
144
145
146
147
148namespace Ogre {
149    // Define ogre version
150    #define OGRE_VERSION_MAJOR 1
151    #define OGRE_VERSION_MINOR 6
152    #define OGRE_VERSION_PATCH 1
153        #define OGRE_VERSION_SUFFIX ""
154    #define OGRE_VERSION_NAME "Shoggoth"
155
156    #define OGRE_VERSION    ((OGRE_VERSION_MAJOR << 16) | (OGRE_VERSION_MINOR << 8) | OGRE_VERSION_PATCH)
157
158    // define the real number values to be used
159    // default to use 'float' unless precompiler option set
160    #if OGRE_DOUBLE_PRECISION == 1
161                /** Software floating point type.
162                @note Not valid as a pointer to GPU buffers / parameters
163                */
164        typedef double Real;
165    #else
166                /** Software floating point type.
167                @note Not valid as a pointer to GPU buffers / parameters
168                */
169        typedef float Real;
170    #endif
171
172    #if OGRE_COMPILER == OGRE_COMPILER_GNUC && OGRE_COMP_VER >= 310 && !defined(STLPORT)
173        #   if OGRE_COMP_VER >= 430
174        #       define HashMap ::std::tr1::unordered_map
175        #               define HashSet ::std::tr1::unordered_set
176        #    else
177        #       define HashMap ::__gnu_cxx::hash_map
178        #       define HashSet ::__gnu_cxx::hash_set
179        #    endif
180    #else
181    #   if OGRE_COMPILER == OGRE_COMPILER_MSVC
182    #       if OGRE_COMP_VER > 1300 && !defined(_STLP_MSVC)
183    #           define HashMap ::stdext::hash_map
184        #           define HashSet ::stdext::hash_set
185    #       else
186    #           define HashMap ::std::hash_map
187        #           define HashSet ::std::hash_set
188    #       endif
189    #   else
190    #       define HashMap ::std::hash_map
191        #       define HashSet ::std::hash_set
192    #   endif
193    #endif
194
195    /** In order to avoid finger-aches :)
196    */
197    typedef unsigned char uchar;
198    typedef unsigned short ushort;
199    typedef unsigned int uint;
200        typedef unsigned long ulong;
201
202        #if OGRE_WCHAR_T_STRINGS
203                typedef std::wstring _StringBase;
204        #else
205                typedef std::string _StringBase;
206        #endif
207
208        typedef _StringBase String;
209
210        // Useful threading defines
211        #define OGRE_AUTO_MUTEX_NAME mutex
212        #if OGRE_THREAD_SUPPORT
213                #define OGRE_AUTO_MUTEX mutable boost::recursive_mutex OGRE_AUTO_MUTEX_NAME;
214                #define OGRE_LOCK_AUTO_MUTEX boost::recursive_mutex::scoped_lock ogreAutoMutexLock(OGRE_AUTO_MUTEX_NAME);
215                #define OGRE_MUTEX(name) mutable boost::recursive_mutex name;
216                #define OGRE_STATIC_MUTEX(name) static boost::recursive_mutex name;
217                #define OGRE_STATIC_MUTEX_INSTANCE(name) boost::recursive_mutex name;
218                #define OGRE_LOCK_MUTEX(name) boost::recursive_mutex::scoped_lock ogrenameLock(name);
219                #define OGRE_LOCK_MUTEX_NAMED(mutexName, lockName) boost::recursive_mutex::scoped_lock lockName(mutexName);
220                // like OGRE_AUTO_MUTEX but mutex held by pointer
221                #define OGRE_AUTO_SHARED_MUTEX mutable boost::recursive_mutex *OGRE_AUTO_MUTEX_NAME;
222                #define OGRE_LOCK_AUTO_SHARED_MUTEX assert(OGRE_AUTO_MUTEX_NAME); boost::recursive_mutex::scoped_lock ogreAutoMutexLock(*OGRE_AUTO_MUTEX_NAME);
223                #define OGRE_NEW_AUTO_SHARED_MUTEX assert(!OGRE_AUTO_MUTEX_NAME); OGRE_AUTO_MUTEX_NAME = new boost::recursive_mutex();
224        #define OGRE_DELETE_AUTO_SHARED_MUTEX assert(OGRE_AUTO_MUTEX_NAME); delete OGRE_AUTO_MUTEX_NAME;
225                #define OGRE_COPY_AUTO_SHARED_MUTEX(from) assert(!OGRE_AUTO_MUTEX_NAME); OGRE_AUTO_MUTEX_NAME = from;
226        #define OGRE_SET_AUTO_SHARED_MUTEX_NULL OGRE_AUTO_MUTEX_NAME = 0;
227        #define OGRE_MUTEX_CONDITIONAL(mutex) if (mutex)
228                #define OGRE_THREAD_SYNCHRONISER(sync) boost::condition sync;
229                #define OGRE_THREAD_WAIT(sync, lock) sync.wait(lock);
230                #define OGRE_THREAD_NOTIFY_ONE(sync) sync.notify_one();
231                #define OGRE_THREAD_NOTIFY_ALL(sync) sync.notify_all();
232                // Thread-local pointer
233                #define OGRE_THREAD_POINTER(T, var) boost::thread_specific_ptr<T> var
234                #define OGRE_THREAD_POINTER_SET(var, expr) var.reset(expr)
235                #define OGRE_THREAD_POINTER_DELETE(var) var.reset(0)
236                #define OGRE_THREAD_POINTER_GET(var) var.get()
237        #else
238                #define OGRE_AUTO_MUTEX
239                #define OGRE_LOCK_AUTO_MUTEX
240                #define OGRE_MUTEX(name)
241                #define OGRE_STATIC_MUTEX(name)
242                #define OGRE_STATIC_MUTEX_INSTANCE(name)
243                #define OGRE_LOCK_MUTEX(name)
244                #define OGRE_LOCK_MUTEX_NAMED(mutexName, lockName)
245                #define OGRE_AUTO_SHARED_MUTEX
246                #define OGRE_LOCK_AUTO_SHARED_MUTEX
247                #define OGRE_NEW_AUTO_SHARED_MUTEX
248                #define OGRE_DELETE_AUTO_SHARED_MUTEX
249                #define OGRE_COPY_AUTO_SHARED_MUTEX(from)
250        #define OGRE_SET_AUTO_SHARED_MUTEX_NULL
251        #define OGRE_MUTEX_CONDITIONAL(name) if(true)
252                #define OGRE_THREAD_SYNCHRONISER(sync)
253                #define OGRE_THREAD_WAIT(sync, lock)
254                #define OGRE_THREAD_NOTIFY_ONE(sync)
255                #define OGRE_THREAD_NOTIFY_ALL(sync)
256                #define OGRE_THREAD_POINTER(T, var) T* var
257                #define OGRE_THREAD_POINTER_SET(var, expr) var = expr
258                #define OGRE_THREAD_POINTER_DELETE(var) OGRE_DELETE var; var = 0
259                #define OGRE_THREAD_POINTER_GET(var) var
260        #endif
261
262
263// Pre-declare classes
264// Allows use of pointers in header files without including individual .h
265// so decreases dependencies between files
266    class Angle;
267    class Animation;
268    class AnimationState;
269    class AnimationStateSet;
270    class AnimationTrack;
271    class Archive;
272    class ArchiveFactory;
273    class ArchiveManager;
274    class AutoParamDataSource;
275    class AxisAlignedBox;
276    class AxisAlignedBoxSceneQuery;
277    class Billboard;
278    class BillboardChain;
279    class BillboardSet;
280    class Bone;
281    class Camera;
282    class Codec;
283    class ColourValue;
284    class ConfigDialog;
285    template <typename T> class Controller;
286    template <typename T> class ControllerFunction;
287    class ControllerManager;
288    template <typename T> class ControllerValue;
289    class Degree;
290    class DynLib;
291    class DynLibManager;
292    class EdgeData;
293    class EdgeListBuilder;
294    class Entity;
295    class ErrorDialog;
296    class ExternalTextureSourceManager;
297    class Factory;
298    class Font;
299    class FontPtr;
300    class FontManager;
301    struct FrameEvent;
302    class FrameListener;
303    class Frustum;
304    class GpuProgram;
305    class GpuProgramPtr;
306    class GpuProgramManager;
307        class GpuProgramUsage;
308    class HardwareIndexBuffer;
309    class HardwareOcclusionQuery;
310    class HardwareVertexBuffer;
311        class HardwarePixelBuffer;
312    class HardwarePixelBufferSharedPtr;
313        class HighLevelGpuProgram;
314    class HighLevelGpuProgramPtr;
315        class HighLevelGpuProgramManager;
316        class HighLevelGpuProgramFactory;
317    class IndexData;
318    class IntersectionSceneQuery;
319    class IntersectionSceneQueryListener;
320    class Image;
321    class KeyFrame;
322    class Light;
323    class Log;
324    class LogManager;
325        class ManualResourceLoader;
326        class ManualObject;
327    class Material;
328    class MaterialPtr;
329    class MaterialManager;
330    class Math;
331    class Matrix3;
332    class Matrix4;
333    class MemoryManager;
334    class Mesh;
335    class MeshPtr;
336    class MeshSerializer;
337    class MeshSerializerImpl;
338    class MeshManager;
339    class MovableObject;
340    class MovablePlane;
341    class Node;
342        class NodeAnimationTrack;
343        class NodeKeyFrame;
344        class NumericAnimationTrack;
345        class NumericKeyFrame;
346    class Overlay;
347    class OverlayContainer;
348    class OverlayElement;
349    class OverlayElementFactory;
350    class OverlayManager;
351    class Particle;
352    class ParticleAffector;
353    class ParticleAffectorFactory;
354    class ParticleEmitter;
355    class ParticleEmitterFactory;
356    class ParticleSystem;
357    class ParticleSystemManager;
358    class ParticleSystemRenderer;
359    class ParticleSystemRendererFactory;
360    class ParticleVisualData;
361    class Pass;
362    class PatchMesh;
363    class PixelBox;
364    class Plane;
365    class PlaneBoundedVolume;
366        class Plugin;
367    class Pose;
368    class ProgressiveMesh;
369    class Profile;
370        class Profiler;
371    class Quaternion;
372        class Radian;
373    class Ray;
374    class RaySceneQuery;
375    class RaySceneQueryListener;
376    class Renderable;
377    class RenderPriorityGroup;
378    class RenderQueue;
379    class RenderQueueGroup;
380        class RenderQueueInvocation;
381        class RenderQueueInvocationSequence;
382    class RenderQueueListener;
383    class RenderSystem;
384    class RenderSystemCapabilities;
385    class RenderSystemCapabilitiesManager;
386    class RenderSystemCapabilitiesSerializer;
387    class RenderTarget;
388    class RenderTargetListener;
389    class RenderTexture;
390        class MultiRenderTarget;
391    class RenderWindow;
392    class RenderOperation;
393    class Resource;
394        class ResourceBackgroundQueue;
395        class ResourceGroupManager;
396    class ResourceManager;
397    class RibbonTrail;
398        class Root;
399    class SceneManager;
400    class SceneManagerEnumerator;
401    class SceneNode;
402    class SceneQuery;
403    class SceneQueryListener;
404        class ScriptCompiler;
405        class ScriptCompilerManager;
406        class ScriptLoader;
407    class Serializer;
408    class ShadowCaster;
409    class ShadowRenderable;
410        class ShadowTextureManager;
411    class SimpleRenderable;
412    class SimpleSpline;
413    class Skeleton;
414    class SkeletonPtr;
415    class SkeletonInstance;
416    class SkeletonManager;
417    class Sphere;
418    class SphereSceneQuery;
419        class StaticGeometry;
420    class StringConverter;
421    class StringInterface;
422    class SubEntity;
423    class SubMesh;
424        class TagPoint;
425    class Technique;
426        class TempBlendedBufferInfo;
427        class ExternalTextureSource;
428    class TextureUnitState;
429    class Texture;
430    class TexturePtr;
431    class TextureManager;
432    class TransformKeyFrame;
433        class Timer;
434    class UserDefinedObject;
435    class Vector2;
436    class Vector3;
437    class Vector4;
438    class Viewport;
439        class VertexAnimationTrack;
440    class VertexBufferBinding;
441    class VertexData;
442    class VertexDeclaration;
443        class VertexMorphKeyFrame;
444    class WireBoundingBox;
445    class Compositor;
446    class CompositorManager;
447    class CompositorChain;
448    class CompositorInstance;
449    class CompositionTechnique;
450    class CompositionPass;
451    class CompositionTargetPass;
452}
453
454#endif // __OgrePrerequisites_H__
455
456
Note: See TracBrowser for help on using the repository browser.