00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __NECORE_H
00029 #define __NECORE_H
00030
00031 #include "base.h"
00032
00033 #include <string>
00034
00035
00052 namespace NeoEngine
00053 {
00054
00055
00056
00057 class ModuleManager;
00058 class Material;
00059 class Console;
00060 class Config;
00061 class FontManager;
00062 class RoomManager;
00063 class TerrainManager;
00064 class Font;
00065 class Mesh;
00066 class ProfileManager;
00067 class RenderDevice;
00068 class InputDevice;
00069 class InputManager;
00070 class FileManager;
00071 class LogSink;
00072
00073 template < class T > class HashTable;
00074 template < class T > class Pool;
00075
00076 typedef HashTable< Material > MaterialTable;
00077 typedef Pool< Mesh > MeshPool;
00078
00079
00080
00081 struct TerrainPrivate;
00082
00083
00084
00089 class NEOENGINE_API Core
00090 {
00091 public:
00092
00096 enum BYTEORDER
00097 {
00099 BYTEORDER_LITTLEENDIAN,
00100
00102 BYTEORDER_BIGENDIAN
00103 };
00104
00105
00106
00107 public:
00108
00109
00110
00111 #if !defined( __MINGW32__ ) || defined( BUILD_STATIC )
00112
00114 static const BYTEORDER BYTEORDER_SYSTEM;
00115
00116 #else
00117
00119 static NEOENGINE_API BYTEORDER BYTEORDER_SYSTEM;
00120
00121 #endif
00122
00123
00124 #ifdef __APPLE__
00125
00127 int m_iHasAltiVec;
00128
00129 #endif
00130
00131
00132 #if defined( ARCH_X86 ) || defined( ARCH_X86_64 )
00133
00135 int m_iHasMMX;
00136
00138 int m_iHasFXSR;
00139
00141 int m_iHasSSE;
00142
00144 int m_iHasSSE2;
00145
00147 int m_iHas3DNow;
00148
00150 int m_iHas3DNowEx;
00151
00152 #endif
00153
00154 private:
00155
00157 static NE_STATIC Core *s_pkSingleton;
00158
00159
00160 protected:
00161
00162
00163
00165 static ModuleManager *s_pkModuleManager;
00166
00168 FileManager *m_pkFileManager;
00169
00171 InputManager *m_pkInputManager;
00172
00174 MaterialTable *m_pkMaterialManager;
00175
00177 MeshPool *m_pkMeshManager;
00178
00180 RoomManager *m_pkRoomManager;
00181
00183 TerrainManager *m_pkTerrainManager;
00184
00186 TerrainPrivate *m_pkTerrainPrivate;
00187
00189 FontManager *m_pkFontManager;
00190
00192 ProfileManager *m_pkProfileManager;
00193
00195 Console *m_pkConsole;
00196
00198 Config *m_pkConfig;
00199
00201 RenderDevice *m_pkRenderDevice;
00202
00204 LogSink *m_pkStdoutSink;
00205
00206
00210 Core();
00211
00212
00213 public:
00214
00215
00218 virtual ~Core();
00219
00220
00221
00222
00229 int Initialize( int iArgs, char **ppszArgs );
00230
00235 int Shutdown();
00236
00237
00238
00239
00253 InputDevice *CreateInputDevice( const std::string &rstrName, RenderDevice *pkRenderDevice = 0, InputManager *pkInputManager = 0 );
00254
00262 void DeleteInputDevice( InputDevice *pkDevice );
00263
00264
00265
00266
00280 RenderDevice *CreateRenderDevice( const std::string &rstrName, FileManager *pkFileManager = 0, InputManager *pkInputManager = 0 );
00281
00289 void DeleteRenderDevice( RenderDevice *pkDevice );
00290
00296 RenderDevice *SetRenderDevice( RenderDevice *pkDevice );
00297
00298
00299
00300
00301
00305 static ModuleManager *GetModuleManager();
00306
00310 inline FileManager *GetFileManager() { return m_pkFileManager; }
00311
00315 inline InputManager *GetInputManager() { return m_pkInputManager; }
00316
00320 inline FontManager *GetFontManager() { return m_pkFontManager; }
00321
00325 inline MaterialTable *GetMaterialManager() { return m_pkMaterialManager; }
00326
00330 inline MeshPool *GetMeshManager() { return m_pkMeshManager; }
00331
00335 inline RoomManager *GetRoomManager() { return m_pkRoomManager; }
00336
00340 void InitializeTerrain( const std::string &rstrName );
00341
00345 inline TerrainManager *GetTerrainManager() { return m_pkTerrainManager; }
00346
00350 inline ProfileManager *GetProfileManager() { return m_pkProfileManager; }
00351
00355 inline Console *GetConsole() { return m_pkConsole; }
00356
00360 inline Config *GetConfig() { return m_pkConfig; }
00361
00365 inline RenderDevice *GetRenderDevice() { return m_pkRenderDevice; }
00366
00370 inline LogSink *GetStdoutSink() { return m_pkStdoutSink; }
00371
00372
00373
00374
00375
00380 void SetConsole( Console *pkConsole );
00381
00382
00383
00384
00385
00390 inline static Core *Get() { if( !s_pkSingleton ) s_pkSingleton = new Core; return s_pkSingleton; }
00391 };
00392
00393
00394 };
00395
00396
00397 #endif
00398