This page has been translated automatically.
Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::EnginePtr Class

Unigine Engine smart pointer.

To use this class, include the UnigineEngine.h file.

Unigine::EnginePtr Class

Members


EnginePtr ()

Default constructor.

EnginePtr (const EnginePtr & pointer)

Copy constructor.

Arguments

  • const EnginePtr & pointer - Engine smart pointer.

EnginePtr (int version, int argc, char ** argv, const char * project, const char * password)

Initialization constructor. Initializes the pointer to a new engine instance.

Arguments

  • int version - Engine version number (UNIGINE_VERSION).
  • int argc - Number of command line arguments.
  • char ** argv - Array of values of command line arguments.
  • const char * project - Project name. If this parameter is set, it forces the engine to store rewritable data (such as log file, cache files, config files) in user profile rather than in a directory with binaries. Notice that only the project name is required to pass in for this parameter, not the full path to the project. If there is no need to change location of such files, pass the NULL value.
  • const char * password - Password for the filesystem archives. Notice that the specified password must be the same as for the project archive (if it exists). Pass the NULL value if you do not need to set a password.

EnginePtr (int version, int argc, wchar_t ** argv, const char * project, const char * password)

Initialization constructor. Initializes the pointer to a new engine instance.

Arguments

  • int version - Engine version number (UNIGINE_VERSION).
  • int argc - Number of command line arguments.
  • wchar_t ** argv - Array of values of command line arguments (a wide-character string).
  • const char * project - Project name. If this parameter is set, it forces the engine to store rewritable data (such as log file, cache files, config files) in user profile rather than in a directory with binaries. Notice that only the project name is required to pass in for this parameter, not the full path to the project. If there is no need to change location of such files, pass the NULL value.
  • const char * password - Password for the filesystem archives. Notice that the specified password must be the same as for the project archive (if it exists). Pass the NULL value if you do not need to set a password.

EnginePtr (int version, App * app, int argc, char ** argv, const char * project, const char * password)

Initialization constructor. Initializes the pointer to a new engine instance to be used with an external graphics application.

Arguments

  • int version - Version number (UNIGINE_VERSION).
  • App * app - Pointer to the graphics App class. Pass the NULL value to ignore this parameter.
  • int argc - Number of command line arguments.
  • char ** argv - Array of values of command line arguments.
  • const char * project - Project name. If this parameter is set, it forces the engine to store rewritable data (such as log file, cache files, config files) in user profile rather than in a directory with binaries. Notice that only the project name is required to pass in for this parameter, not the full path to the project. If there is no need to change location of such files, pass the NULL value.
  • const char * password - Password for the filesystem archives. Notice that the specified password must be the same as for the project archive (if it exists). Pass the NULL value if you do not need to set a password.

EnginePtr (int version, App * app, int argc, wchar_t ** argv, const char * project, const char * password)

Initialization constructor. Initializes the pointer to a new engine instance to be used with an external graphics application.

Arguments

  • int version - Version number (UNIGINE_VERSION).
  • App * app - Pointer to the graphics App class. Pass the NULL value to ignore this parameter.
  • int argc - Number of command line arguments.
  • wchar_t ** argv - Array of values of command line arguments (a wide-character string).
  • const char * project - Project name. If this parameter is set, it forces the engine to store rewritable data (such as log file, cache files, config files) in user profile rather than in a directory with binaries. Notice that only the project name is required to pass in for this parameter, not the full path to the project. If there is no need to change location of such files, pass the NULL value.
  • const char * password - Password for the filesystem archives. Notice that the specified password must be the same as for the project archive (if it exists). Pass the NULL value if you do not need to set a password.

EnginePtr (int version, App * app, const char * app_path, const char * home_path, int argc, char ** argv, const char * project, const char * password)

Initialization constructor. Initializes the pointer to a new engine instance to be used with an external graphics application, which is stored at the specified path.

Arguments

  • int version - Version number (UNIGINE_VERSION).
  • App * app - Pointer to the graphics App class. Pass the NULL value to ignore this parameter.
  • const char * app_path - Path to a directory where binary executable file is stored. Pass the NULL value to ignore this parameter.
  • const char * home_path - Path to the user's home directory.
  • int argc - Number of command line arguments.
  • char ** argv - Array of values of command line arguments.
  • const char * project - Project name. If this parameter is set, it forces the engine to store rewritable data (such as log file, cache files, config files) in user profile rather than in a directory with binaries. Notice that only the project name is required to pass in for this parameter, not the full path to the project. If there is no need to change location of such files, pass the NULL value.
  • const char * password - Password for the filesystem archives. Notice that the specified password must be the same as for the project archive (if it exists). Pass the NULL value if you do not need to set a password. Notice that the specified password must be the same as for the project archive (if it exists). Pass the NULL value if you do not need to set a password.

EnginePtr (int version, App * app, const char * app_path, const char * home_path, int argc, wchar_t ** argv, const char * project, const char * password)

Initialization constructor. Initializes the pointer to a new engine instance to be used with an external graphics application, which is stored at the specified path.

Arguments

  • int version - Version number (UNIGINE_VERSION).
  • App * app - Pointer to the graphics App class. Pass the NULL value to ignore this parameter.
  • const char * app_path - Path to a directory where binary executable file is stored. Pass the NULL value to ignore this parameter.
  • const char * home_path - Path to the user's home directory.
  • int argc - Number of command line arguments.
  • wchar_t ** argv - Array of values of command line arguments (a wide-character string).
  • const char * project - Project name. If this parameter is set, it forces the engine to store rewritable data (such as log file, cache files, config files) in user profile rather than in a directory with binaries. Notice that only the project name is required to pass in for this parameter, not the full path to the project. If there is no need to change location of such files, pass the NULL value.
  • const char * password - Password for the filesystem archives. Notice that the specified password must be the same as for the project archive (if it exists). Pass the NULL value if you do not need to set a password. Notice that the specified password must be the same as for the project archive (if it exists). Pass the NULL value if you do not need to set a password.

~EnginePtr ()

Destructor.

void grab ()

Sets the owner flag to the 1 for the pointer.

void release ()

Sets the owner flag to the 0 for the pointer.

int isOwner () const

Returns the owner flag.

Return value

Owner flag.

void init ()

Initializes the pointer to a new engine instance.

void init (int version, int argc, char ** argv, const char * project, const char * password)

Initializes the pointer to a new engine instance.

Arguments

  • int version - Engine version number (UNIGINE_VERSION).
  • int argc - Number of command line arguments.
  • char ** argv - Array of values of command line arguments.
  • const char * project - Project name. If this parameter is set, it forces the engine to store rewritable data (such as log file, cache files, config files) in user profile rather than in a directory with binaries. Notice that only the project name is required to pass in for this parameter, not the full path to the project. If there is no need to change location of such files, pass the NULL value.
  • const char * password - Password for the filesystem archives. Notice that the specified password must be the same as for the project archive (if it exists). Pass the NULL value if you do not need to set a password.

void init (int version, int argc, wchar_t ** argv, const char * project, const char * password)

Initializes the pointer to a new engine instance.

Arguments

  • int version - Engine version number (UNIGINE_VERSION).
  • int argc - Number of command line arguments.
  • wchar_t ** argv - Array of values of command line arguments (a wide-character string).
  • const char * project - Project name. If this parameter is set, it forces the engine to store rewritable data (such as log file, cache files, config files) in user profile rather than in a directory with binaries. Notice that only the project name is required to pass in for this parameter, not the full path to the project. If there is no need to change location of such files, pass the NULL value.
  • const char * password - Password for the filesystem archives. Notice that the specified password must be the same as for the project archive (if it exists). Pass the NULL value if you do not need to set a password.

void init (int version, App * app, int argc, char ** argv, const char * project, const char * password)

Initializes the pointer to a new engine instance to be used with an external graphics application.

Arguments

  • int version - Version number (UNIGINE_VERSION).
  • App * app - Pointer to the graphics App class. Pass the NULL value to ignore this parameter.
  • int argc - Number of command line arguments.
  • char ** argv - Array of values of command line arguments.
  • const char * project - Project name. If this parameter is set, it forces the engine to store rewritable data (such as log file, cache files, config files) in user profile rather than in a directory with binaries. Notice that only the project name is required to pass in for this parameter, not the full path to the project. If there is no need to change location of such files, pass the NULL value.
  • const char * password - Password for the filesystem archives. Notice that the specified password must be the same as for the project archive (if it exists). Pass the NULL value if you do not need to set a password.

void init (int version, App * app, int argc, wchar_t ** argv, const char * project, const char * password)

Initializes the pointer to a new engine instance to be used with an external graphics application.

Arguments

  • int version - Version number (UNIGINE_VERSION).
  • App * app - Pointer to the graphics App class. Pass the NULL value to ignore this parameter.
  • int argc - Number of command line arguments.
  • wchar_t ** argv - Array of values of command line arguments (a wide-character string).
  • const char * project - Project name. If this parameter is set, it forces the engine to store rewritable data (such as log file, cache files, config files) in user profile rather than in a directory with binaries. Notice that only the project name is required to pass in for this parameter, not the full path to the project. If there is no need to change location of such files, pass the NULL value.
  • const char * password - Password for the filesystem archives. Notice that the specified password must be the same as for the project archive (if it exists). Pass the NULL value if you do not need to set a password.

void init (int version, App * app, const char * app_path, const char * home_path, int argc, char ** argv, const char * project, const char * password)

Initializes the pointer to a new engine instance to be used with an external graphics application, which is stored at the specified path.

Arguments

  • int version - Version number (UNIGINE_VERSION).
  • App * app - Pointer to the graphics App class. Pass the NULL value to ignore this parameter.
  • const char * app_path - Path to a directory where binary executable file is stored. Pass the NULL value to ignore this parameter.
  • const char * home_path - Path to the user's home directory.
  • int argc - Number of command line arguments.
  • char ** argv - Array of values of command line arguments.
  • const char * project - Project name. If this parameter is set, it forces the engine to store rewritable data (such as log file, cache files, config files) in user profile rather than in a directory with binaries. Notice that only the project name is required to pass in for this parameter, not the full path to the project. If there is no need to change location of such files, pass the NULL value.
  • const char * password - Password for the filesystem archives. Notice that the specified password must be the same as for the project archive (if it exists). Pass the NULL value if you do not need to set a password. Notice that the specified password must be the same as for the project archive (if it exists). Pass the NULL value if you do not need to set a password.

void init (int version, App * app, const char * app_path, const char * home_path, int argc, wchar_t ** argv, const char * project, const char * password)

Initializes the pointer to a new engine instance to be used with an external graphics application, which is stored at the specified path.

Arguments

  • int version - Version number (UNIGINE_VERSION).
  • App * app - Pointer to the graphics App class. Pass the NULL value to ignore this parameter.
  • const char * app_path - Path to a directory where binary executable file is stored. Pass the NULL value to ignore this parameter.
  • const char * home_path - Path to the user's home directory.
  • int argc - Number of command line arguments.
  • wchar_t ** argv - Array of values of command line arguments (a wide-character string).
  • const char * project - Project name. If this parameter is set, it forces the engine to store rewritable data (such as log file, cache files, config files) in user profile rather than in a directory with binaries. Notice that only the project name is required to pass in for this parameter, not the full path to the project. If there is no need to change location of such files, pass the NULL value.
  • const char * password - Password for the filesystem archives. Notice that the specified password must be the same as for the project archive (if it exists). Pass the NULL value if you do not need to set a password. Notice that the specified password must be the same as for the project archive (if it exists). Pass the NULL value if you do not need to set a password.

void shutdown ()

Shutdown the pointer to the existing engine instance.

EnginePtr & operator= (const EnginePtr & pointer)

Assignment operator.

Arguments

  • const EnginePtr & pointer - Engine smart pointer.

UNIGINE_INLINE Engine * operator-> () const

Access to the pointer.

Return value

Engine pointer.

UNIGINE_INLINE Engine * get () const

Return the engine pointer.

Return value

Engine pointer.
Last update: 2017-07-03
Build: ()