Drag[en]gine Game Engine
1.21
|
Drag[en]gine Game Engine Class. More...
#include <deEngine.h>
Game Engine Run Time | |
bool | Run (const char *scriptDirectory, const char *gameObject) |
Run game engine. More... | |
bool | Run (const char *scriptDirectory, const char *scriptVersion, const char *gameObject) |
Run game engine. More... | |
void | ResetTimers () |
Reset elapsed time counter. More... | |
void | UpdateElapsedTime () |
Update elapsed time since the last frame update using the internal timer. More... | |
void | RunSingleFrame () |
Run single frame update. More... | |
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 information 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, |
deVirtualFileSystem * | fileSystem = NULL |
||
) |
Create game engine instance.
OS file system is used if the engine installation is located outside the simple confines of an installation directory. If not NULL the file system has to provide the following structure:
[in] | os | OS object to use. Deleted during destructor. |
[in] | fileSystem | OS file system or NULL if not used. |
deEngine::~deEngine | ( | ) |
deAISystem* deEngine::GetAISystem | ( | ) | const |
deAnimationManager* deEngine::GetAnimationManager | ( | ) | const |
deAnimatorInstanceManager* deEngine::GetAnimatorInstanceManager | ( | ) | const |
deAnimatorManager* deEngine::GetAnimatorManager | ( | ) | const |
deAnimatorSystem* deEngine::GetAnimatorSystem | ( | ) | const |
deArchiveManager* deEngine::GetArchiveManager | ( | ) | const |
|
inline |
Command line arguments.
deAudioSystem* deEngine::GetAudioSystem | ( | ) | const |
deBillboardManager* deEngine::GetBillboardManager | ( | ) | const |
|
inline |
Unique catch directory identifier for the application.
If the path is empty no application specific cache will be provided.
deCameraManager* deEngine::GetCameraManager | ( | ) | const |
deCanvasManager* deEngine::GetCanvasManager | ( | ) | const |
deCaptureCanvasManager* deEngine::GetCaptureCanvasManager | ( | ) | const |
deColliderManager* deEngine::GetColliderManager | ( | ) | const |
deComponentManager* deEngine::GetComponentManager | ( | ) | const |
deConnectionManager* deEngine::GetConnectionManager | ( | ) | const |
deCrashRecoverySystem* deEngine::GetCrashRecoverySystem | ( | ) | const |
|
inline |
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.
deDebugDrawerManager* deEngine::GetDebugDrawerManager | ( | ) | const |
deDecalManager* deEngine::GetDecalManager | ( | ) | const |
deDynamicSkinManager* deEngine::GetDynamicSkinManager | ( | ) | const |
deEffectManager* deEngine::GetEffectManager | ( | ) | const |
|
inline |
Time elapsed since the last frame update in seconds.
deEnvMapProbeManager* deEngine::GetEnvMapProbeManager | ( | ) | const |
|
inline |
Error trace object.
deFontManager* deEngine::GetFontManager | ( | ) | const |
deForceFieldManager* deEngine::GetForceFieldManager | ( | ) | const |
int deEngine::GetFPSRate | ( | ) | const |
Frame-per-second rate averaged over the last couple of frames.
deGraphicSystem* deEngine::GetGraphicSystem | ( | ) | const |
deHeightTerrainManager* deEngine::GetHeightTerrainManager | ( | ) | const |
deImageManager* deEngine::GetImageManager | ( | ) | const |
deInputSystem* deEngine::GetInputSystem | ( | ) | const |
deLanguagePackManager* deEngine::GetLanguagePackManager | ( | ) | const |
deLightManager* deEngine::GetLightManager | ( | ) | const |
|
inline |
Logger.
deLumimeterManager* deEngine::GetLumimeterManager | ( | ) | const |
deMicrophoneManager* deEngine::GetMicrophoneManager | ( | ) | const |
deModelManager* deEngine::GetModelManager | ( | ) | const |
|
inline |
deNavigationBlockerManager* deEngine::GetNavigationBlockerManager | ( | ) | const |
deNavigationSpaceManager* deEngine::GetNavigationSpaceManager | ( | ) | const |
deNavigatorManager* deEngine::GetNavigatorManager | ( | ) | const |
deNetworkStateManager* deEngine::GetNetworkStateManager | ( | ) | const |
deNetworkSystem* deEngine::GetNetworkSystem | ( | ) | const |
deOcclusionMeshManager* deEngine::GetOcclusionMeshManager | ( | ) | const |
|
inline |
Operating system object.
|
inline |
OS file system or NULL if not used.
OS file system is used if the engine installation is located outside the simple confines of an installation directory.
|
inline |
Parallel processing.
|
inline |
deParticleEmitterInstanceManager* deEngine::GetParticleEmitterInstanceManager | ( | ) | const |
deParticleEmitterManager* deEngine::GetParticleEmitterManager | ( | ) | const |
|
inline |
Capture directory.
Set by the launcher to indicate to script modules the native path under which capture data is stored or an empty string if not available.
|
inline |
Config directory.
Set by the launcher to indicate to script modules the native path under which config data is stored or an empty string if not available.
|
inline |
Overlay directory.
Set by the launcher to indicate to script modules the native path under which overlay data is stored or an empty string if not available.
dePhysicsSystem* deEngine::GetPhysicsSystem | ( | ) | const |
|
inline |
Default pseudo rundom number generator.
dePropFieldManager* deEngine::GetPropFieldManager | ( | ) | const |
|
inline |
Determine if the engine received a quit request.
deRenderWindowManager* deEngine::GetRenderWindowManager | ( | ) | const |
|
inline |
Resource loader.
deResourceManager* deEngine::GetResourceManagerAt | ( | int | index | ) | const |
int deEngine::GetResourceManagerCount | ( | ) | const |
deResourceManager* deEngine::GetResourceManagerFor | ( | int | resourceType | ) | const |
deRigManager* deEngine::GetRigManager | ( | ) | const |
|
inline |
Scripting system failed.
deScriptingSystem* deEngine::GetScriptingSystem | ( | ) | const |
deServerManager* deEngine::GetServerManager | ( | ) | const |
deSkinManager* deEngine::GetSkinManager | ( | ) | const |
deSkyInstanceManager* deEngine::GetSkyInstanceManager | ( | ) | const |
deSkyManager* deEngine::GetSkyManager | ( | ) | const |
deSmokeEmitterManager* deEngine::GetSmokeEmitterManager | ( | ) | const |
deSoundLevelMeterManager* deEngine::GetSoundLevelMeterManager | ( | ) | const |
deSoundManager* deEngine::GetSoundManager | ( | ) | const |
deSpeakerManager* deEngine::GetSpeakerManager | ( | ) | const |
deSynthesizerInstanceManager* deEngine::GetSynthesizerInstanceManager | ( | ) | const |
deSynthesizerManager* deEngine::GetSynthesizerManager | ( | ) | const |
deSynthesizerSystem* deEngine::GetSynthesizerSystem | ( | ) | const |
deBaseSystem* deEngine::GetSystemAt | ( | int | index | ) | const |
int deEngine::GetSystemCount | ( | ) | const |
|
inline |
Determines if some other system failed.
deTouchSensorManager* deEngine::GetTouchSensorManager | ( | ) | const |
deVideoManager* deEngine::GetVideoManager | ( | ) | const |
deVideoPlayerManager* deEngine::GetVideoPlayerManager | ( | ) | const |
|
inline |
Virtual file system used by the game engine.
deVRSystem* deEngine::GetVRSystem | ( | ) | const |
deWorldManager* deEngine::GetWorldManager | ( | ) | const |
void deEngine::LoadModules | ( | ) |
Scan module directory and loads all modules in there.
void deEngine::Quit | ( | ) |
Requests the engine to quit before the next frame update cycle.
void deEngine::RemoveLeakingResources | ( | ) |
Remove all resources and report them.
This function is used to check if a game left behind unreleased resources and to release the. This ensures a new game can use the same engine without potential left behind resources of the previous game to pollute the memory. Leaving behind resources after the game finished is a bug and thus this function lists all culprit resources as good as possible. The engine call this method before releasing all the resource managers.
void deEngine::ResetFailureFlags | ( | ) |
Reset failure flags.
void deEngine::ResetQuitRequest | ( | ) |
Reset quit request.
void deEngine::ResetTimers | ( | ) |
Reset 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 * | scriptDirectory, |
const char * | gameObject | ||
) |
Run game engine.
bool deEngine::Run | ( | const char * | scriptDirectory, |
const char * | scriptVersion, | ||
const char * | gameObject | ||
) |
Run 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 occurred. 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. |
scriptVersion | Script version the application has been written against. |
gameObject | Initial game object to create. Script module specific value. Usually a class or function name to use to create the game object |
void deEngine::RunSingleFrame | ( | ) |
Run single frame update.
Used by launchers taking control of the entire engine run-time instead of handing it off using the Run function. In particular this does (in this order):
On errors the processing exits the function immediately. Check if GetScriptFailed or GetSystemFailed returns true and enter error handling if this is the case. UpdateElapsedTime or SetElapsedTime has to be called before calling this function.
void deEngine::SetCacheAppID | ( | const char * | cacheAppID | ) |
Set unique catch directory identifier for the application.
If the path is empty no application specific cache will be provided.
void deEngine::SetDataDir | ( | const char * | dataDir | ) |
Set 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.
void deEngine::SetElapsedTime | ( | float | elapsed | ) |
Set the time elapsed since the last frame update in seconds.
Can be called instead of UpdateElapsedTime to explicitely set the elapsed time. Resets the elapsed time timer and updates the FPS Rate.
void deEngine::SetLogger | ( | deLogger * | logger | ) |
Set logger.
void deEngine::SetPathCapture | ( | const char * | path | ) |
Set capture directory.
Set by the launcher to indicate to script modules the native path under which capture data is stored or an empty string if not available.
void deEngine::SetPathConfig | ( | const char * | path | ) |
Set config directory.
Set by the launcher to indicate to script modules the native path under which config data is stored or an empty string if not available.
void deEngine::SetPathOverlay | ( | const char * | path | ) |
Set overlay directory.
Set by the launcher to indicate to script modules the native path under which overlay data is stored or an empty string if not available.
|
inline |
Signals that the scripting system failed.
|
inline |
Signals that some other system failed.
void deEngine::UpdateElapsedTime | ( | ) |
Update elapsed time since the last frame update using the internal timer.
Used by launchers taking control of the entire engine run-time instead of handing it off using the Run function. Use ResetTimers to avoid too long elapsed time after long operations or use SetElapsedTime to set the elapsed time explicitely. Using this function though is the better solution. Updates the FPS rate. After this function RunDoSingleFrame is typically called. Before this function is called ProcessInput has to be called on the active input module and the quit request checked first.