Caelum
CaelumPrerequisites.h
Go to the documentation of this file.
1 /*
2 This file is part of Caelum.
3 See http://www.ogre3d.org/wiki/index.php/Caelum
4 
5 Copyright (c) 2006-2008 Caelum team. See Contributors.txt for details.
6 
7 Caelum is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published
9 by the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Caelum is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16 
17 You should have received a copy of the GNU Lesser General Public License
18 along with Caelum. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef CAELUM__CAELUM_PREREQUISITES_H
22 #define CAELUM__CAELUM_PREREQUISITES_H
23 
24 // Include external headers
25 #ifdef __APPLE__
26 #include "Ogre/Ogre.h"
27 #else
28 #include "Ogre.h"
29 #include "OgreBuildSettings.h"
30 #endif
31 
32 #include "CaelumConfig.h"
33 
34 #include <memory>
35 
36 // Define the dll export qualifier if compiling for Windows
37 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
38  #ifdef CAELUM_LIB
39  #define CAELUM_EXPORT __declspec (dllexport)
40  #else
41  #ifdef __MINGW32__
42  #define CAELUM_EXPORT
43  #else
44  #define CAELUM_EXPORT __declspec (dllimport)
45  #endif
46  #endif
47 #elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
48  #define CAELUM_EXPORT __attribute__ ((visibility("default")))
49 #else
50  #define CAELUM_EXPORT
51 #endif
52 
53 // By default only compile type descriptors for scripting.
54 #ifndef CAELUM_TYPE_DESCRIPTORS
55  #if (OGRE_VERSION >= 0x00010600)
56  #define CAELUM_TYPE_DESCRIPTORS 1
57  #else
58  #define CAELUM_TYPE_DESCRIPTORS 0
59  #endif
60 #endif
61 
62 // Scripting support requires Ogre 1.6
63 // Can be also configured on compiler command line
64 #ifndef CAELUM_SCRIPT_SUPPORT
65  #if (OGRE_VERSION >= 0x00010600)
66  #define CAELUM_SCRIPT_SUPPORT 1
67  #else
68  #define CAELUM_SCRIPT_SUPPORT 0
69  #endif
70 #else
71  #if !(OGRE_VERSION > 0x00010600)
72  #error "Caelum script support requires Ogre 1.6."
73  #endif
74  #if !(CAELUM_TYPE_DESCRIPTORS)
75  #error "Caelum script support also requires type descriptors."
76  #endif
77 #endif
78 
80 
101 namespace Caelum
102 {
103  // Caelum needs a lot of precission for astronomical calculations.
104  // Very few calculations use it, and the precission IS required.
105  typedef double LongReal;
106 
107  // Use some ogre types.
108  using Ogre::uint8;
109  using Ogre::uint16;
110  using Ogre::ushort;
111  using Ogre::uint32;
112  using Ogre::uint;
113 
114  using Ogre::Real;
115  using Ogre::String;
116 
118  static const String RESOURCE_GROUP_NAME = "Caelum";
119 
120  // Render group for caelum stuff
121  // It's best to have them all together
122  enum CaelumRenderQueueGroupId
123  {
124  CAELUM_RENDER_QUEUE_STARFIELD = Ogre::RENDER_QUEUE_SKIES_EARLY + 0,
125  CAELUM_RENDER_QUEUE_MOON_BACKGROUND = Ogre::RENDER_QUEUE_SKIES_EARLY + 1,
126  CAELUM_RENDER_QUEUE_SKYDOME = Ogre::RENDER_QUEUE_SKIES_EARLY + 2,
127  CAELUM_RENDER_QUEUE_MOON = Ogre::RENDER_QUEUE_SKIES_EARLY + 3,
128  CAELUM_RENDER_QUEUE_SUN = Ogre::RENDER_QUEUE_SKIES_EARLY + 4,
129  CAELUM_RENDER_QUEUE_CLOUDS = Ogre::RENDER_QUEUE_SKIES_EARLY + 5,
130  CAELUM_RENDER_QUEUE_GROUND_FOG = Ogre::RENDER_QUEUE_SKIES_EARLY + 6,
131  };
132 
133  // Forward declarations
134  class UniversalClock;
135  class SkyDome;
136  class BaseSkyLight;
137  class Moon;
138  class SphereSun;
139  class SpriteSun;
140  class ImageStarfield;
141  class PointStarfield;
142  class CloudSystem;
143  class CaelumSystem;
144  class FlatCloudLayer;
146  class PrecipitationInstance;
147  class GroundFog;
148  class DepthComposer;
149  class DepthComposerInstance;
150  class DepthRenderer;
151 }
152 
153 namespace Ogre
154 {
155 #if OGRE_VERSION <= 0x010602
156  // Write an Ogre::Degree to a stream.
157  //
158  // Ogre::Any requires that the wrapped type can be written to a stream;
159  // otherwise it will fail on instantation. This function was placed here
160  // so it's available everywhere. This can't be placed in namespace Caelum.
161  //
162  // Ogre 1.6.3 and up already include this operator; so it's ifdefed out.
163  //
164  // This function is never actually used; the output does not matter.
165  inline std::ostream& operator << (std::ostream& out, Ogre::Degree deg) {
166  return out << deg.valueDegrees();
167  }
168 #endif
169 }
170 
171 #endif // CAELUM__CAELUM_PREREQUISITES_H
Image-based starfield class.
Compositor-based precipitation controller.
Compositor-based precipitation controller.
Definition: DepthComposer.h:35
A sky dome element.
Definition: SkyDome.h:33
Base class for sky lights (sun and moon).
Definition: SkyLight.h:31
Per-viewport instance of.
Class representing the sun as billboard with texture on it.
Definition: Sun.h:84
Per-viewport instance of precipitation.
Point starfield class.
Exponential ground fog system implementation.
Definition: GroundFog.h:47
The system&#39;s time model.
A flat cloud layer; drawn as a simple plane.
This is the "root class" of caelum.
Definition: CaelumSystem.h:113
Class representing the sun as sphere with emissive color on it.
Definition: Sun.h:40
A cloud system is implemented by a number of cloud layers.
Definition: CloudSystem.h:31
static const String RESOURCE_GROUP_NAME
Resource group name for caelum resources.
Render the depth buffer to a texture.
Class representing the moon.
Definition: Moon.h:35
Caelum namespace.
Definition: Astronomy.cpp:24