Drag[en]gine Game Engine  1.0
deGraphicSystem Class Reference

Graphic System. More...

#include <deGraphicSystem.h>

Inheritance diagram for deGraphicSystem:
deBaseSystem

Public Member Functions

Constructors and Destructors
 deGraphicSystem (deEngine *engine)
 
virtual ~deGraphicSystem ()
 
Management
deBaseGraphicModuleGetActiveModule () const
 
deRenderWindowGetRenderWindow () const
 
void SetRenderWindow (deRenderWindow *renderWindow)
 
void CreateAndSetRenderWindow (int width, int height, bool fullScreen, const char *title)
 
void CreateAndSetHostedRenderWindow (int width, int height, bool fullScreen, const char *title, Window hostWindow)
 
deCanvasViewGetInputOverlayCanvas () const
 Input system overlay canvas or NULL if not used. More...
 
void SetInputOverlayCanvas (deCanvasView *view)
 Set input system overlay canvas or NULL if not used. More...
 
void RenderWindows ()
 Render windows. More...
 
void LoadBillboard (deBillboard *billboard)
 
void LoadCanvas (deCanvas *canvas)
 Creates the peer object for the given canvas using the active module and assigns it. More...
 
void LoadCamera (deCamera *camera)
 
void LoadCaptureCanvas (deCaptureCanvas *captureCanvas)
 Create peer for capture canvas using active module and assigns it. More...
 
void LoadComponent (deComponent *comp)
 
void LoadDebugDrawer (deDebugDrawer *debugDrawer)
 
void LoadDecal (deDecal *decal)
 
void LoadDynamicSkin (deDynamicSkin *dynamicSkin)
 
void LoadEffect (deEffect *effect)
 
void LoadEnvMapProbe (deEnvMapProbe *envMapProbe)
 
void LoadFont (deFont *font)
 
void LoadHeightTerrain (deHeightTerrain *heightTerrain)
 
void LoadImage (deImage *image)
 
void LoadLight (deLight *light)
 
void LoadLumimeter (deLumimeter *lumimeter)
 
void LoadModel (deModel *model)
 
void LoadOcclusionMesh (deOcclusionMesh *occmesh)
 
void LoadParticleEmitter (deParticleEmitter *emitter)
 
void LoadParticleEmitterInstance (deParticleEmitterInstance *instance)
 
void LoadPropField (dePropField *propField)
 
void LoadRenderWindow (deRenderWindow *renderWindow)
 
void LoadSkin (deSkin *skin)
 
void LoadSky (deSky *sky)
 
void LoadSmokeEmitter (deSmokeEmitter *smokeEmitter)
 
void LoadVideo (deVideo *video)
 
void LoadVideoPlayer (deVideoPlayer *videoPlayer)
 
void LoadWorld (deWorld *world)
 
Overloadables
virtual void SetActiveModule (deLoadableModule *module)
 
virtual void ClearPermanents ()
 
virtual void PostStart ()
 
virtual void PreStop ()
 
- Public Member Functions inherited from deBaseSystem
 deBaseSystem (deEngine *engine, const char *systemName, int requiredModuleType)
 
virtual ~deBaseSystem ()
 
deEngineGetEngine () const
 
deLoadableModuleGetActiveLoadableModule () const
 
bool GetIsRunning () const
 
bool GetHasFailed () const
 
const char * GetSystemName () const
 
virtual bool CanStart ()
 
void SetHasFailed (bool hasFailed)
 
virtual void Start ()
 
virtual void Stop ()
 
void CheckAndActivateFirst (deModuleSystem::eModuleTypes type)
 
void LogInfo (const char *message)
 
void LogInfoFormat (const char *message,...)
 
void LogInfoFormatUsing (const char *message, va_list args)
 
void LogWarn (const char *message)
 
void LogWarnFormat (const char *message,...)
 
void LogWarnFormatUsing (const char *message, va_list args)
 
void LogError (const char *message)
 
void LogErrorFormat (const char *message,...)
 
void LogErrorFormatUsing (const char *message, va_list args)
 
void LogException (const deException &exception)
 

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.
Author
Plüss Roland
Version
1.0
Date
2008

Constructor & Destructor Documentation

◆ deGraphicSystem()

deGraphicSystem::deGraphicSystem ( deEngine engine)

Creates a new graphic system linked to the given engine.

◆ ~deGraphicSystem()

virtual deGraphicSystem::~deGraphicSystem ( )
virtual

Cleans up the graphic system.

Member Function Documentation

◆ ClearPermanents()

virtual void deGraphicSystem::ClearPermanents ( )
virtual

Clears cross references and links that could lead to memory leaks. Do not forget to call the super function.

Reimplemented from deBaseSystem.

Referenced by GetInputOverlayCanvas().

◆ CreateAndSetHostedRenderWindow()

void deGraphicSystem::CreateAndSetHostedRenderWindow ( int  width,
int  height,
bool  fullScreen,
const char *  title,
Window  hostWindow 
)

Creates and sets a new hosted render window.

Referenced by GetRenderWindow().

◆ CreateAndSetRenderWindow()

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

Creates and sets a new render window.

Referenced by GetRenderWindow().

◆ GetActiveModule()

deBaseGraphicModule* deGraphicSystem::GetActiveModule ( ) const
inline

Retrieves the activated graphic module.

◆ GetInputOverlayCanvas()

◆ GetRenderWindow()

deRenderWindow* deGraphicSystem::GetRenderWindow ( ) const
inline

Retrieves the render window.

References CreateAndSetHostedRenderWindow(), CreateAndSetRenderWindow(), and SetRenderWindow().

◆ LoadBillboard()

void deGraphicSystem::LoadBillboard ( deBillboard billboard)

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

Referenced by GetInputOverlayCanvas().

◆ LoadCamera()

void deGraphicSystem::LoadCamera ( deCamera camera)

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

Referenced by GetInputOverlayCanvas().

◆ LoadCanvas()

void deGraphicSystem::LoadCanvas ( deCanvas canvas)

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

Referenced by GetInputOverlayCanvas().

◆ LoadCaptureCanvas()

void deGraphicSystem::LoadCaptureCanvas ( deCaptureCanvas captureCanvas)

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

Referenced by GetInputOverlayCanvas().

◆ LoadComponent()

void deGraphicSystem::LoadComponent ( deComponent comp)

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

Referenced by GetInputOverlayCanvas().

◆ LoadDebugDrawer()

void deGraphicSystem::LoadDebugDrawer ( deDebugDrawer debugDrawer)

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

Referenced by GetInputOverlayCanvas().

◆ LoadDecal()

void deGraphicSystem::LoadDecal ( deDecal decal)

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

Referenced by GetInputOverlayCanvas().

◆ LoadDynamicSkin()

void deGraphicSystem::LoadDynamicSkin ( deDynamicSkin dynamicSkin)

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

Referenced by GetInputOverlayCanvas().

◆ LoadEffect()

void deGraphicSystem::LoadEffect ( deEffect effect)

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

Referenced by GetInputOverlayCanvas().

◆ LoadEnvMapProbe()

void deGraphicSystem::LoadEnvMapProbe ( deEnvMapProbe envMapProbe)

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

Referenced by GetInputOverlayCanvas().

◆ LoadFont()

void deGraphicSystem::LoadFont ( deFont font)

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

Referenced by GetInputOverlayCanvas().

◆ LoadHeightTerrain()

void deGraphicSystem::LoadHeightTerrain ( deHeightTerrain heightTerrain)

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

Referenced by GetInputOverlayCanvas().

◆ LoadImage()

void deGraphicSystem::LoadImage ( deImage image)

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

Referenced by GetInputOverlayCanvas().

◆ LoadLight()

void deGraphicSystem::LoadLight ( deLight light)

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

Referenced by GetInputOverlayCanvas().

◆ LoadLumimeter()

void deGraphicSystem::LoadLumimeter ( deLumimeter lumimeter)

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

Referenced by GetInputOverlayCanvas().

◆ LoadModel()

void deGraphicSystem::LoadModel ( deModel model)

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

Referenced by GetInputOverlayCanvas().

◆ LoadOcclusionMesh()

void deGraphicSystem::LoadOcclusionMesh ( deOcclusionMesh occmesh)

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

Referenced by GetInputOverlayCanvas().

◆ LoadParticleEmitter()

void deGraphicSystem::LoadParticleEmitter ( deParticleEmitter emitter)

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

Referenced by GetInputOverlayCanvas().

◆ LoadParticleEmitterInstance()

void deGraphicSystem::LoadParticleEmitterInstance ( deParticleEmitterInstance instance)

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

Referenced by GetInputOverlayCanvas().

◆ LoadPropField()

void deGraphicSystem::LoadPropField ( dePropField propField)

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

Referenced by GetInputOverlayCanvas().

◆ LoadRenderWindow()

void deGraphicSystem::LoadRenderWindow ( deRenderWindow renderWindow)

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

Referenced by GetInputOverlayCanvas().

◆ LoadSkin()

void deGraphicSystem::LoadSkin ( deSkin skin)

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

Referenced by GetInputOverlayCanvas().

◆ LoadSky()

void deGraphicSystem::LoadSky ( deSky sky)

Creates the peer object for the given sky using the active module and assigns it.

Referenced by GetInputOverlayCanvas().

◆ LoadSmokeEmitter()

void deGraphicSystem::LoadSmokeEmitter ( deSmokeEmitter smokeEmitter)

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

Referenced by GetInputOverlayCanvas().

◆ LoadVideo()

void deGraphicSystem::LoadVideo ( deVideo video)

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

Referenced by GetInputOverlayCanvas().

◆ LoadVideoPlayer()

void deGraphicSystem::LoadVideoPlayer ( deVideoPlayer videoPlayer)

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

Referenced by GetInputOverlayCanvas().

◆ LoadWorld()

void deGraphicSystem::LoadWorld ( deWorld world)

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

Referenced by GetInputOverlayCanvas().

◆ PostStart()

virtual void deGraphicSystem::PostStart ( )
virtual

Carry out here actions right after the system started up.

Reimplemented from deBaseSystem.

Referenced by GetInputOverlayCanvas().

◆ PreStop()

virtual void deGraphicSystem::PreStop ( )
virtual

Carry out here actions right before the system shuts down.

Reimplemented from deBaseSystem.

Referenced by GetInputOverlayCanvas().

◆ 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.

Referenced by GetInputOverlayCanvas().

◆ SetActiveModule()

virtual void deGraphicSystem::SetActiveModule ( deLoadableModule module)
virtual

Sets the active loadable module. Do not forget to call the super function.

Reimplemented from deBaseSystem.

Referenced by GetInputOverlayCanvas().

◆ SetInputOverlayCanvas()

void deGraphicSystem::SetInputOverlayCanvas ( deCanvasView view)

Set input system overlay canvas or NULL if not used.

Referenced by GetInputOverlayCanvas().

◆ SetRenderWindow()

void deGraphicSystem::SetRenderWindow ( deRenderWindow renderWindow)

Sets the render window.

Referenced by GetRenderWindow().


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