My Project
Globals.h
1 #pragma once
2 #include <vector>
3 #include <stack>
4 
5 namespace ParaEngine
6 {
7  class IParaEngineApp;
8  class TransformStack;
11  {
12  G_STR_EMPTY = 0,
13  G_STR_OK,
14  G_STR_ERROR,
15  };
17  enum FRCType
18  {
19  FRC_RENDER = 0,
20  FRC_SIM,
21  FRC_IO,
22  FRC_GAME,
23  FRC_LAST,
24  };
25 
31  class CGlobals
32  {
33  public:
34  CGlobals(void);
35  ~CGlobals(void);
36  public:
38  static IParaEngineApp* GetApp();
39  static CAISimulator* GetAISim();
40  static CReport* GetReport();
41  static CFileManager* GetFileManager();
42  static CPluginManager* GetPluginManager();
43  static ParaInfoCenter::CICConfigManager* GetICConfigManager();
44  static CEventsCenter* GetEventsCenter();
47  static NPL::INPLStimulationPipe* GetNetworkLayer();
48  static ParaEngineSettings& GetSettings();
49  static CGUIRoot* GetGUI();
50  static CParaWorldAsset* GetAssetManager();
51  static CSceneObject* GetScene();
52  static ParaTerrain::CGlobalTerrain* GetGlobalTerrain();
55  static SceneState*GetSceneState();
56  static CWorldInfo* GetWorldInfo();
57 
60  static const string& GetString(int nStringID=0);
65  static bool WillGenReport(const char* itemName = NULL);
66 
68  static double GetGameTime();
69 
72 
74  static const Matrix4* GetIdentityMatrix();
75 
79  static TransformStack& GetViewMatrixStack();
80  static TransformStack& GetProjectionMatrixStack();
81  static CPhysicsWorld* GetPhysicsWorld();
82  static CViewportManager* GetViewportManager();
83  static CSelectionManager* GetSelectionManager();
84  static COceanManager* GetOceanManager();
85  static IEnvironmentSim* GetEnvSim();
86  static CLightManager* GetLightManager();
87 
89  static bool IsLoading();
91  static void SetLoading(bool bIsLoading);
92 
93  static RenderDevicePtr GetRenderDevice();
94  static EffectManager* GetEffectManager();
95 
96  static CAttributesManager* GetAttributesManager();
97  static CDataProviderManager* GetDataProviderManager();
98 
99  static CMoviePlatform* GetMoviePlatform();
100 
104  static HWND GetAppHWND();
105 #ifdef PLATFORM_WINDOWS
106  static CAudioEngine* GetAudioEngine();
107  public:
109  static DirectXEngine& GetDirectXEngine();
110 #endif
111  };
112 
113 
115  class TransformStack : public std::stack<Matrix4, std::vector<Matrix4> >
116  {
117  public:
118  TransformStack(){};
119 
121  inline const Matrix4& SafeGetTop(){ return !empty() ? top() : Matrix4::IDENTITY; }
122 
124  inline void SafeSetTop(const Matrix4& mat){ if(!empty()) top() = mat;}
125  };
126 
127 }
static IParaEngineApp * GetApp()
get the application interface.
Definition: Globals.cpp:74
a global pool for user registered custom events.
Definition: EventsCenter.h:28
static void SetLoading(bool bIsLoading)
set whether the scene is loading.
Definition: Globals.cpp:164
It&#39;s used as parameter to Draw method of each scene object.
Definition: SceneState.h:284
Providing information about the current game world.
Definition: WorldInfo.h:12
static NPL::CNPLRuntime * GetNPLRuntime()
get the current NPL runtime environment.
Definition: Globals.cpp:120
managing local lights.
Definition: LightManager.h:12
this is the main file interface exposed by ParaEngine.
Definition: FileManager.h:32
static bool WillGenReport(const char *itemName=NULL)
return whether frame based report will be generated for a specified item, itemName: name of the repo...
Definition: Globals.cpp:143
different physics engine has different winding order.
Definition: EventBinding.h:32
static HWND GetAppHWND()
Definition: Globals.cpp:284
Class: CAudioEngine.
Definition: AudioEngine.h:49
a central place for managing all attributes of all classes in ParaEngine.
Definition: AttributesManager.h:9
manage plug-ins
Definition: PluginManager.h:117
this is the interface class for managing global terrain used in ParaEngine.
Definition: GlobalTerrain.h:36
a very thin wrapper to DirectX device with a portable version of openGL implementation.
Definition: RenderDeviceDirectX.h:10
static bool IsLoading()
check whether the scene is loading.
Definition: Globals.cpp:159
const Matrix4 & SafeGetTop()
get the top() matrix, if the stack is empty, it will return identity matrix
Definition: Globals.h:121
a class consists of static functions to access global objects in ParaEngine, such as Current Root Sce...
Definition: Globals.h:31
static double GetGameTime()
get the game time in seconds
Definition: Globals.cpp:99
the class for all frame rate controller.
Definition: FrameRateController.h:10
CNPLRuntime is a wrapper of the NPL application programming interface (NPL API).
Definition: NPLRuntime.h:64
static const Matrix4 * GetIdentityMatrix()
get an identity matrix.
Definition: Globals.cpp:154
AI and AI scripts handlers.
Definition: AISimulator.h:28
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: ParaMatrix4.h:23
For managing and rendering the movie.
Definition: MoviePlatform.h:21
The CICConfigManager manages the global configurations of the program.
Definition: ICConfigManager.h:62
static const string & GetString(int nStringID=0)
get static string used in the game engine.
Definition: Globals.cpp:168
static SceneState * GetSceneState()
get the scene state information.
Definition: Globals.cpp:221
GLOBAL_STRING_ID
a table of global strings.
Definition: Globals.h:10
The top level scene management class.
Definition: SceneObject.h:58
void SafeSetTop(const Matrix4 &mat)
it will only set if top is not empty
Definition: Globals.h:124
FRCType
frame rate controller type
Definition: Globals.h:17
a singleton class for managing all data providers used in the game engine.
Definition: DataProviderManager.h:20
The global physics scene (NxScene) and physics SDK is encapsulated in a member object of scene manage...
Definition: PhysicsWorld.h:18
manager all effects file used by the game engine.
Definition: EffectManager.h:16
static CFrameRateController * GetFrameRateController(FRCType nType)
get a given frame rate controller used by the game engine.
Definition: Globals.cpp:125
this is a default report class.
Definition: Report.h:15
static TransformStack & GetWorldMatrixStack()
world matrix stack.
Definition: Globals.cpp:79
for world view projection transformation stack
Definition: Globals.h:115
the asset manager class in ParaEngine.
Definition: ParaWorldAsset.h:44
a table of virtual functions which are used by plug-ins to access the game engine ...
Definition: IParaEngineApp.h:98
A pool of currently selected objects.
Definition: SelectionManager.h:102
manager multiple viewport
Definition: ViewportManager.h:18
FFT based ocean rendering class.
Definition: OceanManager.h:56
environment simulator.
Definition: IEnvironmentSim.h:103
When rendering scene, root scene and the root GUI are rendered in sequence.
Definition: GUIRoot.h:48
global settings for ParaEngine.
Definition: ParaEngineSettings.h:36