Drag[en]gine Game Engine Class. More...
#include <deEngine.h>
Public Member Functions | |
Constructors and Destructors | |
| deEngine (deOS *os) | |
| Creates a new instance of a game engine. | |
| ~deEngine () | |
System Accessors | |
Retrieves various System objects. | |
| deModuleSystem * | GetModuleSystem () const |
| int | GetSystemCount () const |
| deBaseSystem * | GetSystemAt (int index) const |
| deGraphicSystem * | GetGraphicSystem () const |
| deInputSystem * | GetInputSystem () const |
| dePhysicsSystem * | GetPhysicsSystem () const |
| deScriptingSystem * | GetScriptingSystem () const |
| deCrashRecoverySystem * | GetCrashRecoverySystem () const |
| deAnimatorSystem * | GetAnimatorSystem () const |
| deAudioSystem * | GetAudioSystem () const |
| deNetworkSystem * | GetNetworkSystem () const |
| deAISystem * | GetAISystem () const |
| void | LoadModules () |
| Scans the module directory and loads all modules in there. | |
Crash Recovery System ( CRS ) | |
Signals to the game engine unexpected errors in one of the engine systems. During the next update cycle the engine will enter CRS mode to handle the errors. | |
| deErrorTrace * | GetErrorTrace () const |
| Retrieves the error trace object. | |
| void | SignalScriptFailed () |
| Signals that the scripting system failed. | |
| void | SignalSystemFailed () |
| Signals that some other system failed. | |
| deLogger * | GetLogger () const |
| Retrieves the logger. | |
| void | SetLogger (deLogger *logger) |
| Sets the logger. | |
Resource Manager Accessors | |
Retrieves various resource managers. You can either retrieve them by index or by specifying the resource type you are looking for. Furthermore there are convenience functions to safely access a resource manager of the given type. | |
| int | GetResourceManagerCount () const |
| deResourceManager * | GetResourceManagerAt (int index) const |
| deResourceManager * | GetResourceManagerFor (int resourceType) const |
| deAIManager * | GetAIManager () const |
| deAnimationManager * | GetAnimationManager () const |
| deAnimatorManager * | GetAnimatorManager () const |
| deBillboardManager * | GetBillboardManager () const |
| deCameraManager * | GetCameraManager () const |
| deColliderManager * | GetColliderManager () const |
| deComponentManager * | GetComponentManager () const |
| deConnectionManager * | GetConnectionManager () const |
| deDebugDrawerManager * | GetDebugDrawerManager () const |
| deDecalManager * | GetDecalManager () const |
| deDynamicSkinManager * | GetDynamicSkinManager () const |
| deEffectManager * | GetEffectManager () const |
| deFontManager * | GetFontManager () const |
| deForceFieldManager * | GetForceFieldManager () const |
| deGraphicContextManager * | GetGraphicContextManager () const |
| deHeightTerrainManager * | GetHeightTerrainManager () const |
| deImageManager * | GetImageManager () const |
| deLanguagePackManager * | GetLanguagePackManager () const |
| deLightManager * | GetLightManager () const |
| deLumimeterManager * | GetLumimeterManager () const |
| deMicrophoneManager * | GetMicrophoneManager () const |
| deModelManager * | GetModelManager () const |
| deNetworkStateManager * | GetNetworkStateManager () const |
| deOccluderManager * | GetOccluderManager () const |
| deParticleEmitterManager * | GetParticleEmitterManager () const |
| dePortalSystemManager * | GetPortalSystemManager () const |
| dePropFieldManager * | GetPropFieldManager () const |
| deRenderTargetManager * | GetRenderTargetManager () const |
| deRenderWindowManager * | GetRenderWindowManager () const |
| deRigManager * | GetRigManager () const |
| deServerManager * | GetServerManager () const |
| deSkinManager * | GetSkinManager () const |
| deSkyManager * | GetSkyManager () const |
| deSmokeEmitterManager * | GetSmokeEmitterManager () const |
| deSoundManager * | GetSoundManager () const |
| deSpeakerManager * | GetSpeakerManager () const |
| deTouchSensorManager * | GetTouchSensorManager () const |
| deVideoManager * | GetVideoManager () const |
| deVideoPlayerManager * | GetVideoPlayerManager () const |
| deWorldManager * | GetWorldManager () const |
| deResourceLoader * | GetResourceLoader () const |
| Retrieves the resource loader. | |
File System Management | |
| const char * | GetDataDir () const |
| const char * | GetEnginePath () const |
| Retrieves the path to the engine library and module files. | |
| const char * | GetConfigPath () const |
| Retrieves the path to the engine library and modules configuration files. | |
| const char * | GetSharePath () const |
| Retrieves the path to the shared files. | |
| deVirtualFileSystem * | GetVirtualFileSystem () const |
| Retrieves the virtual file system used by the game engine. | |
| void | SetDataDir (const char *dataDir) |
| Sets the game data directory. | |
Texture Properties | |
| deTexturePropertyMap * | GetTexturePropertyMap () const |
| Retrieves the texture property map. | |
| void | NotifyTexturePropertyMapChanged () |
| Notifies all modules using texture properties that the texture property map changed. | |
Frame Information Accessors | |
| float | GetElapsedTime () const |
| Retrieves the time elapsed since the last frame update in seconds. | |
| int | GetFPSRate () const |
| Retrieves the frame-per-second rate averaged over the last couple of frames. | |
Operating System Bindings | |
| deCmdLineArgs * | GetArguments () const |
| Retrieves the command line arguments. | |
| deOS * | GetOS () const |
| Retrieves the operating system object. | |
| void | Quit () |
| Requests the engine to quit before the next frame update cycle. | |
Game Engine Run Time | |
| bool | Run (const char *scriptDir) |
| Runs the game engine. | |
| void | ResetTimers () |
| Resets the elapsed time counter. | |
Drag[en]gine Game Engine Class.
Manages the runtime of the entire game engine. Create one instance of this class for each game running. The class is safe to be used in multiple instances but this behaviour can be restricted by single type modules grabbing certain devices.
To launch successfully a game with this engine create first one instance of this class. Then set your game specific informations to the shared data directory of the engine and your game data directory. You are now ready to launch the game by calling the run function. You need to specify the script directory inside your data directory where the scripting module has to look for your game scripts. The run function catches exceptions itself hence there is no need to enclose it in a try-catch block.
If you plan to use the library in slave mode hence only for rendering and you provide the run loop then you can do parts of the run() function yourself. Be carefull though as wrong setting will result in crashes. Wrapping all in an try-catch clause should be enough for testing to be safe.
| deEngine::deEngine | ( | deOS * | os ) |
Creates a new instance of a game engine.
Uses the given OS to operate the engine and modules.
| deEngine::~deEngine | ( | ) |
| deAIManager* deEngine::GetAIManager | ( | ) | const |
| deAISystem* deEngine::GetAISystem | ( | ) | const |
| deAnimationManager* deEngine::GetAnimationManager | ( | ) | const |
| deAnimatorManager* deEngine::GetAnimatorManager | ( | ) | const |
| deAnimatorSystem* deEngine::GetAnimatorSystem | ( | ) | const |
| deCmdLineArgs* deEngine::GetArguments | ( | ) | const [inline] |
Retrieves the command line arguments.
| deAudioSystem* deEngine::GetAudioSystem | ( | ) | const |
| deBillboardManager* deEngine::GetBillboardManager | ( | ) | const |
| deCameraManager* deEngine::GetCameraManager | ( | ) | const |
| deColliderManager* deEngine::GetColliderManager | ( | ) | const |
| deComponentManager* deEngine::GetComponentManager | ( | ) | const |
| const char* deEngine::GetConfigPath | ( | ) | const [inline] |
Retrieves the path to the engine library and modules configuration files.
Do not access this directory directly unless you really know what you are doing. Use the access functions provided by the subclassed engine module to access your configuration files safely.
| deConnectionManager* deEngine::GetConnectionManager | ( | ) | const |
| deCrashRecoverySystem* deEngine::GetCrashRecoverySystem | ( | ) | const |
| const char* deEngine::GetDataDir | ( | ) | const [inline] |
| deDebugDrawerManager* deEngine::GetDebugDrawerManager | ( | ) | const |
| deDecalManager* deEngine::GetDecalManager | ( | ) | const |
| deDynamicSkinManager* deEngine::GetDynamicSkinManager | ( | ) | const |
| deEffectManager* deEngine::GetEffectManager | ( | ) | const |
| float deEngine::GetElapsedTime | ( | ) | const [inline] |
Retrieves the time elapsed since the last frame update in seconds.
| const char* deEngine::GetEnginePath | ( | ) | const [inline] |
Retrieves the path to the engine library and module files.
Do not access this directory directly unless you really know what you are doing. Use the access functions provided by the subclassed engine module to access your library files safely.
| deErrorTrace* deEngine::GetErrorTrace | ( | ) | const [inline] |
Retrieves the error trace object.
| deFontManager* deEngine::GetFontManager | ( | ) | const |
| deForceFieldManager* deEngine::GetForceFieldManager | ( | ) | const |
| int deEngine::GetFPSRate | ( | ) | const |
Retrieves the frame-per-second rate averaged over the last couple of frames.
| deGraphicContextManager* deEngine::GetGraphicContextManager | ( | ) | const |
| deGraphicSystem* deEngine::GetGraphicSystem | ( | ) | const |
| deHeightTerrainManager* deEngine::GetHeightTerrainManager | ( | ) | const |
| deImageManager* deEngine::GetImageManager | ( | ) | const |
| deInputSystem* deEngine::GetInputSystem | ( | ) | const |
| deLanguagePackManager* deEngine::GetLanguagePackManager | ( | ) | const |
| deLightManager* deEngine::GetLightManager | ( | ) | const |
| deLogger* deEngine::GetLogger | ( | ) | const [inline] |
Retrieves the logger.
| deLumimeterManager* deEngine::GetLumimeterManager | ( | ) | const |
| deMicrophoneManager* deEngine::GetMicrophoneManager | ( | ) | const |
| deModelManager* deEngine::GetModelManager | ( | ) | const |
| deModuleSystem* deEngine::GetModuleSystem | ( | ) | const [inline] |
| deNetworkStateManager* deEngine::GetNetworkStateManager | ( | ) | const |
| deNetworkSystem* deEngine::GetNetworkSystem | ( | ) | const |
| deOccluderManager* deEngine::GetOccluderManager | ( | ) | const |
| deOS* deEngine::GetOS | ( | ) | const [inline] |
Retrieves the operating system object.
| deParticleEmitterManager* deEngine::GetParticleEmitterManager | ( | ) | const |
| dePhysicsSystem* deEngine::GetPhysicsSystem | ( | ) | const |
| dePortalSystemManager* deEngine::GetPortalSystemManager | ( | ) | const |
| dePropFieldManager* deEngine::GetPropFieldManager | ( | ) | const |
| deRenderTargetManager* deEngine::GetRenderTargetManager | ( | ) | const |
| deRenderWindowManager* deEngine::GetRenderWindowManager | ( | ) | const |
| deResourceLoader* deEngine::GetResourceLoader | ( | ) | const [inline] |
Retrieves the resource loader.
| deResourceManager* deEngine::GetResourceManagerAt | ( | int | index ) | const |
| int deEngine::GetResourceManagerCount | ( | ) | const |
| deResourceManager* deEngine::GetResourceManagerFor | ( | int | resourceType ) | const |
| deRigManager* deEngine::GetRigManager | ( | ) | const |
| deScriptingSystem* deEngine::GetScriptingSystem | ( | ) | const |
| deServerManager* deEngine::GetServerManager | ( | ) | const |
| const char* deEngine::GetSharePath | ( | ) | const [inline] |
Retrieves the path to the shared files.
Do not access this directory directly unless you really know what you are doing. Use the access functions provided by the subclassed engine module to access your library files safely. If you are a launcher get your shares from inside a directory named according to yourself from the "launcher" directory inside this path.
| deSkinManager* deEngine::GetSkinManager | ( | ) | const |
| deSkyManager* deEngine::GetSkyManager | ( | ) | const |
| deSmokeEmitterManager* deEngine::GetSmokeEmitterManager | ( | ) | const |
| deSoundManager* deEngine::GetSoundManager | ( | ) | const |
| deSpeakerManager* deEngine::GetSpeakerManager | ( | ) | const |
| deBaseSystem* deEngine::GetSystemAt | ( | int | index ) | const |
| int deEngine::GetSystemCount | ( | ) | const |
| deTexturePropertyMap* deEngine::GetTexturePropertyMap | ( | ) | const [inline] |
Retrieves the texture property map.
| deTouchSensorManager* deEngine::GetTouchSensorManager | ( | ) | const |
| deVideoManager* deEngine::GetVideoManager | ( | ) | const |
| deVideoPlayerManager* deEngine::GetVideoPlayerManager | ( | ) | const |
| deVirtualFileSystem* deEngine::GetVirtualFileSystem | ( | ) | const [inline] |
Retrieves the virtual file system used by the game engine.
| deWorldManager* deEngine::GetWorldManager | ( | ) | const |
| void deEngine::LoadModules | ( | ) |
Scans the module directory and loads all modules in there.
| void deEngine::NotifyTexturePropertyMapChanged | ( | ) |
Notifies all modules using texture properties that the texture property map changed.
| void deEngine::Quit | ( | ) |
Requests the engine to quit before the next frame update cycle.
| void deEngine::ResetTimers | ( | ) |
Resets the elapsed time counter.
This is usefull after lengthy time operations like loading a game. Without this call the reported amount of seconds elapsed since the last frame update can grow tremendously huge resulting in strange movements in the first frame after the player takes control.
| bool deEngine::Run | ( | const char * | scriptDir ) |
Runs the game engine.
Calling this function the control is handed over to the game engine. The scripts in the specified directory ( relative to the data directory ) are parsed and executed. This function returns control to you after a quit-request has been issued or an unrecoverable error has occured. The return value indicates if the game engine exited under normal circumstances or due to a severe error. This function already handles exceptions so there is no need to enclose it in a try-catch block.
| scriptDir | Directory relative to data directory containing the script files for your game |
| void deEngine::SetDataDir | ( | const char * | dataDir ) |
Sets the game data directory.
This directory is considered the virtual root directory of your gama data. All files handled with the file manager retrieved through GetFileManager are relative to this directory. The game engine uses this file manager to locate all resource files. Also the scripting system expects script files to be somewhere inside this directory.
| dataDir | data directory with optional slash at the end |
| void deEngine::SetLogger | ( | deLogger * | logger ) |
Sets the logger.
| void deEngine::SignalScriptFailed | ( | ) | [inline] |
Signals that the scripting system failed.
| void deEngine::SignalSystemFailed | ( | ) | [inline] |
Signals that some other system failed.
1.7.2