This page has been translated automatically.
Programming
Fundamentals
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Engine Functions

The Engine class is required for the engine initialization and executing the main loop of the program. Also, you can get the engine startup options through this class.

Engine Class

Members


string engine.getAppPath()

Returns a path to the binary executable file.

Return value

Path to the executable file.

string engine.getArg(int num)

Returns a command line argument by its index.

Arguments

  • int num - Command line argument index.

Return value

Command line argument, string.

virtual string engine.getCachePath() const =0

Returns a path where cache files will be stored.

Return value

Path to a directory for cache files.

ControlsApp engine.getControls()

Returns a ControlsApp object that handles input from the current application window.

Return value

An instance of the ControlsApp class.

string engine.getDataPath(int num = 0)

Returns a path to the -data_pathdirectory specified at the engine startup.

Arguments

  • int num - Number of the specified -data_pathdirectory. For example, if the are three directories, their numbers will be 1, 2 and 3.

Return value

Data directory.

string engine.getEditorScript()

Returns a path to the editor script (provided by the -editor_scriptcommand line argument).

Return value

Path to the editor script.

string engine.getError()

Returns the system error message.

Return value

The system error message of the current frame, if there is one; otherwise an empty string.

string engine.getExternDefines()

Returns the UnigineScript definitions specified at launch.

Return value

The list of UnigineScript definitions.

Gui engine.getGui()

Returns a system GUI associated with the engine and used to manipulate the user interface.

Return value

System GUI used to manipulate the user interface.

string engine.getHomePath()

Returns a path to the user's home directory.

Return value

Path to the user's home directory.

float engine.getInterfaceTime()

Returns a total accumulative time spent on rendering the GUI widgets.

Return value

Time value, in milliseconds.

int engine.isMainThread()

Checks if the current thread is main.

Return value

1 if the current thread is main; otherwise, 0.

string engine.getMessage()

Returns the last system message of the current frame, or empty string if there are no messages.

Return value

The last system message.

virtual int engine.getNumArgs() const =0

Returns the number of command line arguments.

Return value

Number of command line arguments.

int engine.getNumDataPaths()

Returns the number of the specified -data_pathdirectories.

Return value

Number of data directories.

int engine.getNumPluginPaths()

Returns the number of plugins paths specified via -plugin_path.

Return value

Number of paths to plugins.

int engine.getNumPluginPaths()

virtual string engine.getPluginName(int num) const =0

Returns the name of the loaded plugin by its index.

Arguments

  • int num - Index of the loaded plugin.

Return value

Loaded plugin name.

string engine.getPluginPath(int num)

Returns a path to plugin directory specified via -plugin_path by its number.

Arguments

  • int num - Plugin path number in the row of the specified plugin paths.

Return value

Path to a plugin directory.

float engine.getRenderTime()

Returns the time value, required to prepare all data to be rendered in the current frame and feed rendering commands from the CPU to the GPU. See the Profiler article for details.

Return value

Rendering time value, milliseconds.

virtual string engine.getSavePath() const =0

Returns a path where a default configuration file, save files and screenshots will be stored.

Return value

Path to a directory for default configuration file, save files, etc.

string engine.getSoundApp()

Returns a sound API used for rendering.

Return value

A sound API instance.

string engine.getSystemScript()

Returns a path to the system script.

Return value

Path to the system script.

float engine.getTotalTime()

Returns the total time that both rendering and calculating of the frame took (the duration of the main loop in the application execution sequence).

Return value

Total time value, milliseconds.

float engine.getUpdateTime()

Returns the duration of the update phase, during which the objects are prepared for their collision response to be calculated.

Return value

The update phase duration value, milliseconds.

string engine.getVideoApp()

Returns a graphics API used for rendering.

Return value

Graphics API used for rendering.

void engine.dialogError(string title)

Displays a dialog window with errors set using the error() function.

Arguments

  • string title - Title to be displayed in the error window.

void engine.dialogMessage(string title)

Displays a dialog window with the last message set using the message() function.

Arguments

  • string title - Title to be displayed in the message window.

void engine.error(string format, ... values)

Adds a text describing an error to the list of errors.

Arguments

void engine.message(string format, ... values)

Adds a new message to the list of messages.

Arguments

Last update: 2017-07-03
Build: ()