Drag[en]gine Game Engine  1.21
deGraphicSystem Class Reference

Graphic System. More...

#include <deGraphicSystem.h>

Inheritance diagram for deGraphicSystem:
deBaseSystem

Public Member Functions

Constructors and Destructors
 deGraphicSystem (deEngine *engine)
 Create new graphic system linked to the given engine. More...
 
virtual ~deGraphicSystem ()
 Clean up graphic system. More...
 
Management
deBaseGraphicModuleGetActiveModule () const
 Activated graphic module. More...
 
deRenderWindowGetRenderWindow () const
 Render window. More...
 
void SetRenderWindow (deRenderWindow *renderWindow)
 Set render window. More...
 
void CreateAndSetRenderWindow (int width, int height, bool fullScreen, const char *title, deImage *icon)
 Creates and sets a new render window. More...
 
deCanvasViewGetInputOverlayCanvas () const
 Creates and sets a new hosted render window. More...
 
void SetInputOverlayCanvas (deCanvasView *view)
 Set input system overlay canvas or NULL if not used. More...
 
deCanvasViewGetDebugOverlayCanvas () const
 Debug overlay canvas. More...
 
void RenderWindows ()
 Render windows. More...
 
void CreateGlobalResources ()
 Create global resources. More...
 
void LoadBillboard (deBillboard *billboard)
 Create peer object for the given billboard using the active module and assigns it. More...
 
void LoadCanvas (deCanvas *canvas)
 Create peer object for the given canvas using the active module and assigns it. More...
 
void LoadCamera (deCamera *camera)
 Create peer object for the given camera using the active module and assigns it. More...
 
void LoadCaptureCanvas (deCaptureCanvas *captureCanvas)
 Create peer for capture canvas using active module and assigns it. More...
 
void LoadComponent (deComponent *comp)
 Create peer object for the given component using the active module and assigns it. More...
 
void LoadDebugDrawer (deDebugDrawer *debugDrawer)
 Create peer object for the given debug drawer using the active module and assigns it. More...
 
void LoadDecal (deDecal *decal)
 Create peer object for the given decal using the active module and assigns it. More...
 
void LoadDynamicSkin (deDynamicSkin *dynamicSkin)
 Create peer for the dynamic skin using the active module and assigns it. More...
 
void LoadEffect (deEffect *effect)
 Create peer object for the given effect using the active module and assigns it. More...
 
void LoadEnvMapProbe (deEnvMapProbe *envMapProbe)
 Create peer object for the given environment mapü probe using the active module and assigns it. More...
 
void LoadFont (deFont *font)
 Create peer object for the given font using the active module and assigns it. More...
 
void LoadHeightTerrain (deHeightTerrain *heightTerrain)
 Create peer object for the given height terrain using the active module and assigns it. More...
 
void LoadImage (deImage *image)
 Create peer object for the given image using the active module and assigns it. More...
 
void LoadLight (deLight *light)
 Create peer object for the given light using the active module and assigns it. More...
 
void LoadLumimeter (deLumimeter *lumimeter)
 Create peer object for the given lumimeter using the active module and assigns it. More...
 
void LoadModel (deModel *model)
 Create peer object for the given model using the active module and assigns it. More...
 
void LoadOcclusionMesh (deOcclusionMesh *occmesh)
 Create peer for the occlusion mesh using the active module and assigns it. More...
 
void LoadParticleEmitter (deParticleEmitter *emitter)
 Create peer for the particle emitter using the active module and assigns it. More...
 
void LoadParticleEmitterInstance (deParticleEmitterInstance *instance)
 Create peer for the particle emitter instance using the active module and assigns it. More...
 
void LoadPropField (dePropField *propField)
 Create peer object for the given prop field using the active module and assigns it. More...
 
void LoadRenderWindow (deRenderWindow *renderWindow)
 Create peer object for the given render window using the active module and assigns it. More...
 
void LoadSkin (deSkin *skin)
 Create peer object for the given skin using the active module and assigns it. More...
 
void LoadSky (deSky *sky)
 Create and assign peer for sky using active module. More...
 
void LoadSkyInstance (deSkyInstance *sky)
 Create and assign peer for sky instance using active module. More...
 
void LoadSmokeEmitter (deSmokeEmitter *smokeEmitter)
 Create peer for the smoke emitter using the active module and assigns it. More...
 
void LoadVideo (deVideo *video)
 Create peer for the video using the active module and assigns it. More...
 
void LoadVideoPlayer (deVideoPlayer *videoPlayer)
 Create peer for the video player using the active module and assigns it. More...
 
void LoadWorld (deWorld *world)
 Create peer object for the given world using the active module and assigns it. More...
 
Overloadables
virtual void SetActiveModule (deLoadableModule *module)
 Set active loadable module. More...
 
virtual void ClearPermanents ()
 Clearcross references and links that could lead to memory leaks. More...
 
virtual void PostStart ()
 Carry out here actions right after the system started up. More...
 
virtual void PreStop ()
 Carry out here actions right before the system shuts down. More...
 
- Public Member Functions inherited from deBaseSystem
 deBaseSystem (deEngine *engine, const char *systemName, int requiredModuleType)
 Create new base system linked to the given engine. More...
 
virtual ~deBaseSystem ()
 Clean up base system. More...
 
deEngineGetEngine () const
 Linked game engine. More...
 
deLoadableModuleGetActiveLoadableModule () const
 Active loadable module. More...
 
bool GetIsRunning () const
 System is running. More...
 
bool GetHasFailed () const
 System has failed during runtime. More...
 
const decStringGetSystemName () const
 System name. More...
 
virtual bool CanStart ()
 
void SetHasFailed (bool hasFailed)
 Set if system has failed. More...
 
virtual void Start ()
 Start system and the active loadable module. More...
 
virtual void Stop ()
 Stop system and the active loadable module. More...
 
void CheckAndActivateFirst (deModuleSystem::eModuleTypes type)
 Check if at least one module is working and select the first one. More...
 
void LogInfo (const char *message)
 Output information message on the console. More...
 
void LogInfoFormat (const char *message,...)
 Output formated information message on the console. More...
 
void LogInfoFormatUsing (const char *message, va_list args)
 Output formated information message on the console. More...
 
void LogWarn (const char *message)
 Output warning message on the console. More...
 
void LogWarnFormat (const char *message,...)
 Output formated warning message on the console. More...
 
void LogWarnFormatUsing (const char *message, va_list args)
 Output formated warning message on the console. More...
 
void LogError (const char *message)
 Output error message on the console. More...
 
void LogErrorFormat (const char *message,...)
 Output formated error message on the console. More...
 
void LogErrorFormatUsing (const char *message, va_list args)
 Output formated error message on the console. More...
 
void LogException (const deException &exception)
 Output exception as error message on the console. More...
 

Detailed Description

Graphic System.

The graphic system is a single type system providing the output functions of the engine in the graphic direction. Everything drawn to the screen including the windows required for this task are managed by the graphic system. This system provides the most peers into engine objects as it is a system requiring heavy optimizations to provide good speed also on weaker computers. A graphic system provides one special render target the Primary Render Target. This render target can not be created manually and represents the means to render to the main output location. You can create manually render targets for rendering to non visible places if you wish.

Note
Currently the render system expects a buffer swapping to be done for the output object. This is true in the case of games but for other applications using the engine in headless mode this is overkill. Furthermore for a pure GUI intro menu without 3d graphics used buffer swapping is overkill too. An possible solution is to allow setting a buffer-switching flag. If the flag is not set always the same buffer is used and drawing takes place immediatly the way operating systems handle drawing. With buffer switching activated each time you finish a frame the the buffers are switched. In the later scenario you have to draw the entire screen each time wheras in the former you only have to render if needed.
Currently the graphic system manages render targets instead of a separate render target manager. This is a bad situation and will be changed in the future. The render target becomes an own resource type and a manager.

Constructor & Destructor Documentation

◆ deGraphicSystem()

deGraphicSystem::deGraphicSystem ( deEngine engine)

Create new graphic system linked to the given engine.

◆ ~deGraphicSystem()

virtual deGraphicSystem::~deGraphicSystem ( )
virtual

Clean up graphic system.

Member Function Documentation

◆ ClearPermanents()

virtual void deGraphicSystem::ClearPermanents ( )
virtual

Clearcross references and links that could lead to memory leaks.

Do not forget to call the super function.

Reimplemented from deBaseSystem.

◆ CreateAndSetRenderWindow()

void deGraphicSystem::CreateAndSetRenderWindow ( int  width,
int  height,
bool  fullScreen,
const char *  title,
deImage icon 
)

Creates and sets a new render window.

◆ CreateGlobalResources()

void deGraphicSystem::CreateGlobalResources ( )

Create global resources.

◆ GetActiveModule()

deBaseGraphicModule* deGraphicSystem::GetActiveModule ( ) const
inline

Activated graphic module.

◆ GetDebugOverlayCanvas()

deCanvasView* deGraphicSystem::GetDebugOverlayCanvas ( ) const
inline

Debug overlay canvas.

This overlay is for use by modules to display debug information. Each canvas added to this view is considered as one debug data block. The graphic module is at liberty to arrange the these canvas as it sees fit. For this reason modules should not expect their debug canvas to stay in a particular order. Best use a deCanvasView for each individual debug data block. Helper classes can be found in the debug directory. They provide ready made debug data blocks that can be filled with information easily.

◆ GetInputOverlayCanvas()

deCanvasView* deGraphicSystem::GetInputOverlayCanvas ( ) const
inline

Creates and sets a new hosted render window.

Input system overlay canvas or NULL if not used.

◆ GetRenderWindow()

deRenderWindow* deGraphicSystem::GetRenderWindow ( ) const
inline

Render window.

◆ LoadBillboard()

void deGraphicSystem::LoadBillboard ( deBillboard billboard)

Create peer object for the given billboard using the active module and assigns it.

◆ LoadCamera()

void deGraphicSystem::LoadCamera ( deCamera camera)

Create peer object for the given camera using the active module and assigns it.

◆ LoadCanvas()

void deGraphicSystem::LoadCanvas ( deCanvas canvas)

Create peer object for the given canvas using the active module and assigns it.

◆ LoadCaptureCanvas()

void deGraphicSystem::LoadCaptureCanvas ( deCaptureCanvas captureCanvas)

Create peer for capture canvas using active module and assigns it.

◆ LoadComponent()

void deGraphicSystem::LoadComponent ( deComponent comp)

Create peer object for the given component using the active module and assigns it.

◆ LoadDebugDrawer()

void deGraphicSystem::LoadDebugDrawer ( deDebugDrawer debugDrawer)

Create peer object for the given debug drawer using the active module and assigns it.

◆ LoadDecal()

void deGraphicSystem::LoadDecal ( deDecal decal)

Create peer object for the given decal using the active module and assigns it.

◆ LoadDynamicSkin()

void deGraphicSystem::LoadDynamicSkin ( deDynamicSkin dynamicSkin)

Create peer for the dynamic skin using the active module and assigns it.

◆ LoadEffect()

void deGraphicSystem::LoadEffect ( deEffect effect)

Create peer object for the given effect using the active module and assigns it.

◆ LoadEnvMapProbe()

void deGraphicSystem::LoadEnvMapProbe ( deEnvMapProbe envMapProbe)

Create peer object for the given environment mapü probe using the active module and assigns it.

◆ LoadFont()

void deGraphicSystem::LoadFont ( deFont font)

Create peer object for the given font using the active module and assigns it.

◆ LoadHeightTerrain()

void deGraphicSystem::LoadHeightTerrain ( deHeightTerrain heightTerrain)

Create peer object for the given height terrain using the active module and assigns it.

◆ LoadImage()

void deGraphicSystem::LoadImage ( deImage image)

Create peer object for the given image using the active module and assigns it.

◆ LoadLight()

void deGraphicSystem::LoadLight ( deLight light)

Create peer object for the given light using the active module and assigns it.

◆ LoadLumimeter()

void deGraphicSystem::LoadLumimeter ( deLumimeter lumimeter)

Create peer object for the given lumimeter using the active module and assigns it.

◆ LoadModel()

void deGraphicSystem::LoadModel ( deModel model)

Create peer object for the given model using the active module and assigns it.

◆ LoadOcclusionMesh()

void deGraphicSystem::LoadOcclusionMesh ( deOcclusionMesh occmesh)

Create peer for the occlusion mesh using the active module and assigns it.

◆ LoadParticleEmitter()

void deGraphicSystem::LoadParticleEmitter ( deParticleEmitter emitter)

Create peer for the particle emitter using the active module and assigns it.

◆ LoadParticleEmitterInstance()

void deGraphicSystem::LoadParticleEmitterInstance ( deParticleEmitterInstance instance)

Create peer for the particle emitter instance using the active module and assigns it.

◆ LoadPropField()

void deGraphicSystem::LoadPropField ( dePropField propField)

Create peer object for the given prop field using the active module and assigns it.

◆ LoadRenderWindow()

void deGraphicSystem::LoadRenderWindow ( deRenderWindow renderWindow)

Create peer object for the given render window using the active module and assigns it.

◆ LoadSkin()

void deGraphicSystem::LoadSkin ( deSkin skin)

Create peer object for the given skin using the active module and assigns it.

◆ LoadSky()

void deGraphicSystem::LoadSky ( deSky sky)

Create and assign peer for sky using active module.

◆ LoadSkyInstance()

void deGraphicSystem::LoadSkyInstance ( deSkyInstance sky)

Create and assign peer for sky instance using active module.

◆ LoadSmokeEmitter()

void deGraphicSystem::LoadSmokeEmitter ( deSmokeEmitter smokeEmitter)

Create peer for the smoke emitter using the active module and assigns it.

◆ LoadVideo()

void deGraphicSystem::LoadVideo ( deVideo video)

Create peer for the video using the active module and assigns it.

◆ LoadVideoPlayer()

void deGraphicSystem::LoadVideoPlayer ( deVideoPlayer videoPlayer)

Create peer for the video player using the active module and assigns it.

◆ LoadWorld()

void deGraphicSystem::LoadWorld ( deWorld world)

Create peer object for the given world using the active module and assigns it.

◆ PostStart()

virtual void deGraphicSystem::PostStart ( )
virtual

Carry out here actions right after the system started up.

Reimplemented from deBaseSystem.

◆ PreStop()

virtual void deGraphicSystem::PreStop ( )
virtual

Carry out here actions right before the system shuts down.

Reimplemented from deBaseSystem.

◆ RenderWindows()

void deGraphicSystem::RenderWindows ( )

Render windows.

Tells the graphic module changes for this frame update are finished and the existing render windows can be rendered if required. Depending on the graphic module implementation this can be a synchronous rendering in the main thread or an asynchronous rendering in a render thread. Most modules will use a render thread though. This is a synchronization point and execution will return once the graphic module has finished all necessary preparation and rendering tasks if required. After the call returns the operating system window resources are guaranteed to be valid either with the current frame changes or the image rendered since the last call to RenderWindows(). It is at the distretion of the graphic module to decide if it shows the last frame or the current frame for best performance. For this reason run RenderWindows in regular intervals.

◆ SetActiveModule()

virtual void deGraphicSystem::SetActiveModule ( deLoadableModule module)
virtual

Set active loadable module.

Do not forget to call the super function.

Reimplemented from deBaseSystem.

◆ SetInputOverlayCanvas()

void deGraphicSystem::SetInputOverlayCanvas ( deCanvasView view)

Set input system overlay canvas or NULL if not used.

◆ SetRenderWindow()

void deGraphicSystem::SetRenderWindow ( deRenderWindow renderWindow)

Set render window.


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