PixelLightAPI  .
Protected Member Functions
PLCore::FrontendApplication Class Reference

Frontend application class. More...

#include <FrontendApplication.h>

Inheritance diagram for PLCore::FrontendApplication:
Inheritance graph
[legend]

List of all members.

Protected Member Functions

PLCORE_API FrontendApplication (Frontend &cFrontend)
 Returns the frontend this application is running in.
virtual PLCORE_API ~FrontendApplication ()
 Destructor.
virtual PLCORE_API void OnStop () override
 De-initialization function that is called after OnDeInit()
virtual PLCORE_API void OnSize () override
 Called when the window size has been changed.
virtual PLCORE_API void OnFullscreenMode () override
 Called when the fullscreen mode was changed.
virtual PLCORE_API void OnDraw () override
 Called to let the frontend draw into it's window.
virtual PLCORE_API void OnUpdate () override
 Called to let the frontend update it's states.
virtual PLCORE_API void OnDrop (const Container< String > &lstFiles) override
 Called when string data has been dropped onto the frontend window.
virtual PLCORE_API void OnInitConfig () override
 Called when application should initialize it's configuration.
virtual PLCORE_API void OnInitPlugins () override
 Called when application should load it's plugins.
virtual PLCORE_API void OnInitData () override
 Called when application should set it's data paths.

Detailed Description

Frontend application class.

Remarks:
As the name of this class indicates, this is the base class for applications running within a frontend (the application host). The main loop as well as other logic is handed over to a host in order to become passive. Although a frontend application is always running within a frontend, it shouldn't care about the frontend. Just write our application as if there wouldn't be any "outer world". By following this philosophy as close as possible and only accessing frontend features when really necessary, you enhance the chance that your application can be embedded within other applications like browsers such as MS Internet Explorer or Mozilla Firefox without problems.

Constructor & Destructor Documentation

PLCORE_API PLCore::FrontendApplication::FrontendApplication ( Frontend cFrontend) [protected]

Returns the frontend this application is running in.

Returns:
Frontend this application instance is running in
Note:
  • Try to avoid to access the frontend whenever possible (Hollywood Principle: "Don't call us, we'll call you")

Constructor

Parameters:
[in]cFrontendFrontend this application instance is running in
Note:
  • This constructor sets the default application name and title by using the name of the frontend executable ("GetFrontend().GetContext().GetName()")
virtual PLCORE_API PLCore::FrontendApplication::~FrontendApplication ( ) [protected, virtual]

Destructor.


Member Function Documentation

virtual PLCORE_API void PLCore::FrontendApplication::OnStop ( ) [override, protected, virtual]

De-initialization function that is called after OnDeInit()

Remarks:
The default implementation does the following tasks:
  • Get frontend position and size of the current session and write frontend configuration
  • Everything that CoreApplication::OnStop() does

Reimplemented from PLCore::CoreApplication.

Reimplemented in PLEngine::EngineApplication, PLScene::SceneApplication, and PLRenderer::RendererApplication.

virtual PLCORE_API void PLCore::FrontendApplication::OnSize ( ) [override, protected, virtual]

Called when the window size has been changed.

Note:
  • The default implementation is empty

Implements PLCore::AbstractFrontend.

virtual PLCORE_API void PLCore::FrontendApplication::OnFullscreenMode ( ) [override, protected, virtual]

Called when the fullscreen mode was changed.

Remarks:
This method just says "something related to fullscreen mode has been changed". Whether we changed from window mode into fullscreen mode or changed e.g. the resolution used in fullscreen mode is not really interesting in here.
Note:
  • The default implementation is empty

Implements PLCore::AbstractFrontend.

Reimplemented in PLRenderer::RendererApplication.

virtual PLCORE_API void PLCore::FrontendApplication::OnDraw ( ) [override, protected, virtual]

Called to let the frontend draw into it's window.

Note:
  • The default implementation is empty

Implements PLCore::AbstractFrontend.

Reimplemented in PLRenderer::RendererApplication.

virtual PLCORE_API void PLCore::FrontendApplication::OnUpdate ( ) [override, protected, virtual]

Called to let the frontend update it's states.

Remarks:
You can use this method to do work you have to perform on a regular basis. It's recommended to keep the work done within the implementation as compact as possible. Don't use this function to perform 'polling'-everything, use events or if required for example timers or threads instead.
Note:
  • The default implementation is empty

Implements PLCore::AbstractFrontend.

Reimplemented in PLEngine::EngineApplication, PLEngine::ScriptApplication, PLRenderer::RendererApplication, and PLScene::SceneApplication.

virtual PLCORE_API void PLCore::FrontendApplication::OnDrop ( const Container< String > &  lstFiles) [override, protected, virtual]

Called when string data has been dropped onto the frontend window.

Parameters:
[in]lstFilesList of file names
Note:
  • The default implementation is empty

Implements PLCore::AbstractFrontend.

virtual PLCORE_API void PLCore::FrontendApplication::OnInitConfig ( ) [override, protected, virtual]

Called when application should initialize it's configuration.

Remarks:
The default implementation does the following tasks:
Note:
  • Part of the application framework initialization function "OnStart()"

Reimplemented from PLCore::CoreApplication.

virtual PLCORE_API void PLCore::FrontendApplication::OnInitPlugins ( ) [override, protected, virtual]

Called when application should load it's plugins.

Remarks:
The default implementation does the following tasks:
  • Scan for plugins in application executable directory non-recursively
  • If the application executable directory is not the same as the application startup directory, scan for plugins in application startup directory non-recursively
Note:
  • Part of the application framework initialization function "OnStart()"

Reimplemented from PLCore::CoreApplication.

virtual PLCORE_API void PLCore::FrontendApplication::OnInitData ( ) [override, protected, virtual]

Called when application should set it's data paths.

Remarks:
The default implementation does the following tasks:
  • Set '.' as base path in LoadableManager
  • Scan for packages in "Data/" directory
  • Set application directory as base path in LoadableManager
  • Scan for packages in application directory "Data/" directory
  • Get current language and load PixelLight localization file, if no language is defined, English is used as default
Note:
  • Part of the application framework initialization function "OnStart()"

Reimplemented from PLCore::CoreApplication.


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


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:25
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported