deEngine Class Reference

Drag[en]gine Game Engine Class. More...

#include <deEngine.h>

List of all members.

Public Member Functions

Constructors and Destructors
 deEngine (deOS *os)
 Creates a new instance of a game engine.
 ~deEngine ()
System Accessors

Retrieves various System objects.

deModuleSystemGetModuleSystem () const
int GetSystemCount () const
deBaseSystemGetSystemAt (int index) const
deGraphicSystemGetGraphicSystem () const
deInputSystemGetInputSystem () const
dePhysicsSystemGetPhysicsSystem () const
deScriptingSystemGetScriptingSystem () const
deCrashRecoverySystemGetCrashRecoverySystem () const
deAnimatorSystemGetAnimatorSystem () const
deAudioSystemGetAudioSystem () const
deNetworkSystemGetNetworkSystem () const
deAISystemGetAISystem () 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.

deErrorTraceGetErrorTrace () const
 Retrieves the error trace object.
void SignalScriptFailed ()
 Signals that the scripting system failed.
void SignalSystemFailed ()
 Signals that some other system failed.
deLoggerGetLogger () 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
deResourceManagerGetResourceManagerAt (int index) const
deResourceManagerGetResourceManagerFor (int resourceType) const
deAIManagerGetAIManager () const
deAnimationManagerGetAnimationManager () const
deAnimatorManagerGetAnimatorManager () const
deBillboardManagerGetBillboardManager () const
deCameraManagerGetCameraManager () const
deColliderManagerGetColliderManager () const
deComponentManagerGetComponentManager () const
deConnectionManagerGetConnectionManager () const
deDebugDrawerManagerGetDebugDrawerManager () const
deDecalManagerGetDecalManager () const
deDynamicSkinManagerGetDynamicSkinManager () const
deEffectManagerGetEffectManager () const
deFontManagerGetFontManager () const
deForceFieldManagerGetForceFieldManager () const
deGraphicContextManagerGetGraphicContextManager () const
deHeightTerrainManagerGetHeightTerrainManager () const
deImageManagerGetImageManager () const
deLanguagePackManagerGetLanguagePackManager () const
deLightManagerGetLightManager () const
deLumimeterManagerGetLumimeterManager () const
deMicrophoneManagerGetMicrophoneManager () const
deModelManagerGetModelManager () const
deNetworkStateManagerGetNetworkStateManager () const
deOccluderManagerGetOccluderManager () const
deParticleEmitterManagerGetParticleEmitterManager () const
dePortalSystemManagerGetPortalSystemManager () const
dePropFieldManagerGetPropFieldManager () const
deRenderTargetManagerGetRenderTargetManager () const
deRenderWindowManagerGetRenderWindowManager () const
deRigManagerGetRigManager () const
deServerManagerGetServerManager () const
deSkinManagerGetSkinManager () const
deSkyManagerGetSkyManager () const
deSmokeEmitterManagerGetSmokeEmitterManager () const
deSoundManagerGetSoundManager () const
deSpeakerManagerGetSpeakerManager () const
deTouchSensorManagerGetTouchSensorManager () const
deVideoManagerGetVideoManager () const
deVideoPlayerManagerGetVideoPlayerManager () const
deWorldManagerGetWorldManager () const
deResourceLoaderGetResourceLoader () 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.
deVirtualFileSystemGetVirtualFileSystem () const
 Retrieves the virtual file system used by the game engine.
void SetDataDir (const char *dataDir)
 Sets the game data directory.
Texture Properties
deTexturePropertyMapGetTexturePropertyMap () 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
deCmdLineArgsGetArguments () const
 Retrieves the command line arguments.
deOSGetOS () 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.

Detailed Description

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.

Author:
Plüss Roland
Version:
1.0
Date:
2008

Constructor & Destructor Documentation

deEngine::deEngine ( deOS os )

Creates a new instance of a game engine.

Uses the given OS to operate the engine and modules.

deEngine::~deEngine (  )

Member Function Documentation

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.

Parameters:
scriptDirDirectory relative to data directory containing the script files for your game
Returns:
true if the game engine exited under normal circumstances or false if an unrecoverable error occured
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.

Parameters:
dataDirdata 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.


The documentation for this class was generated from the following file: