PixelLightAPI
.
|
Script application class. More...
#include <ScriptApplication.h>
Public Member Functions | |
PL_API | ScriptApplication (PLCore::Frontend &cFrontend) |
Constructor. | |
PL_API | ScriptApplication (PLCore::Frontend &cFrontend, PLCore::String sScriptFilename) |
Constructor for loading in and executing a scripted stand-alone application using just a single line of C++ code. | |
PL_API | ScriptApplication (PLCore::Frontend &cFrontend, PLCore::String sScriptFilename, PLCore::String sName, PLCore::String sTitle, PLCore::String sAppDataSubdir) |
Constructor for loading in and executing a scripted stand-alone application using just a single line of C++ code. | |
virtual PL_API | ~ScriptApplication () |
Destructor. | |
PL_API PLCore::String | GetBaseDirectory () const |
Returns the base directory of the application. | |
PL_API void | SetBaseDirectory (const PLCore::String &sBaseDirectory) |
Sets the base directory of the application. | |
PL_API PLCore::Script * | GetScript () const |
Returns the used script instance. | |
PL_API PLCore::String | GetScriptFilename () const |
Returns the absolute filename of the used script. | |
PL_API PLCore::String | GetScriptDirectory () const |
Returns the absolute directory the used script is in. | |
Protected Member Functions | |
virtual PL_API void | OnInit () |
Called when application should initialize itself. | |
virtual PL_API void | OnDeInit () |
Called when application should de-initialize itself. | |
virtual PL_API void | OnUpdate () override |
Called to let the frontend update it's states. | |
PL_API bool | LoadScript (const PLCore::String &sFilename) |
Loads a script. | |
PL_API void | DestroyScript () |
Destroys the currently used script. | |
Protected Attributes | |
PLCore::String | m_sInitialScriptFilename |
Script application class.
PL_API PLEngine::ScriptApplication::ScriptApplication | ( | PLCore::Frontend & | cFrontend | ) |
Constructor.
[in] | cFrontend | Frontend this application instance is running in |
PL_API PLEngine::ScriptApplication::ScriptApplication | ( | PLCore::Frontend & | cFrontend, |
PLCore::String | sScriptFilename | ||
) |
Constructor for loading in and executing a scripted stand-alone application using just a single line of C++ code.
[in] | cFrontend | Frontend this application instance is running in |
[in] | sScriptFilename | Filename of the script to load |
* Usage example: * int PLMain(const String &sExecutableFilename, const Array<String> &lstArguments) * { * return ScriptApplication("Data/Scripts/45ScriptApplication.lua").Run(sExecutableFilename, lstArguments); * } *
PL_API PLEngine::ScriptApplication::ScriptApplication | ( | PLCore::Frontend & | cFrontend, |
PLCore::String | sScriptFilename, | ||
PLCore::String | sName, | ||
PLCore::String | sTitle, | ||
PLCore::String | sAppDataSubdir | ||
) |
Constructor for loading in and executing a scripted stand-alone application using just a single line of C++ code.
[in] | cFrontend | Frontend this application instance is running in |
[in] | sScriptFilename | Filename of the script to load |
[in] | sName | Optional name of the application, if empty string a name is constructed automatically by using the filename of the script |
[in] | sTitle | Optional title of the application, if empty string a title is constructed automatically by using the filename of the script |
[in] | sAppDataSubdir | Optional subdirectory for application data files, if empty string a directory is constructed automatically by using the filename of the script |
* Usage example: * int PLMain(const String &sExecutableFilename, const Array<String> &lstArguments) * { * return ScriptApplication("Data/Scripts/45ScriptApplication.lua").Run(sExecutableFilename, lstArguments); * } *
virtual PL_API PLEngine::ScriptApplication::~ScriptApplication | ( | ) | [virtual] |
Destructor.
PL_API PLCore::String PLEngine::ScriptApplication::GetBaseDirectory | ( | ) | const |
Returns the base directory of the application.
PL_API void PLEngine::ScriptApplication::SetBaseDirectory | ( | const PLCore::String & | sBaseDirectory | ) |
Sets the base directory of the application.
[in] | sBaseDirectory | The base directory of the application (e.g. on Windows: 'C:\') |
PL_API PLCore::Script* PLEngine::ScriptApplication::GetScript | ( | ) | const |
Returns the used script instance.
PL_API PLCore::String PLEngine::ScriptApplication::GetScriptFilename | ( | ) | const |
Returns the absolute filename of the used script.
PL_API PLCore::String PLEngine::ScriptApplication::GetScriptDirectory | ( | ) | const |
Returns the absolute directory the used script is in.
virtual PL_API void PLEngine::ScriptApplication::OnInit | ( | ) | [protected, virtual] |
Called when application should initialize itself.
Reimplemented from PLCore::CoreApplication.
virtual PL_API void PLEngine::ScriptApplication::OnDeInit | ( | ) | [protected, virtual] |
Called when application should de-initialize itself.
Reimplemented from PLCore::CoreApplication.
virtual PL_API void PLEngine::ScriptApplication::OnUpdate | ( | ) | [override, protected, virtual] |
Called to let the frontend update it's states.
Reimplemented from PLEngine::EngineApplication.
PL_API bool PLEngine::ScriptApplication::LoadScript | ( | const PLCore::String & | sFilename | ) | [protected] |
Loads a script.
[in] | sFilename | Filename of the script to load |
PL_API void PLEngine::ScriptApplication::DestroyScript | ( | ) | [protected] |
Destroys the currently used script.
Initial filename of the script to use
|