This page has been translated automatically.
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
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1
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.

Unigine::Plugin Class

Unigine Plugin allows loading a custom library dynamically at Unigine runtime.

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

Unigine::Plugin Class

Members


virtual ~Plugin ()

Virtual destructor.

virtual int get_version () const

Plugin version.

Return value

Returns the Engine version.

virtual const char * get_name ()

Plugin name.

Return value

The plugin name.

virtual void * get_data ()

Plugin data.

Return value

The plugin data.

virtual int init ()

Engine calls this function on plugin initialization.

Return value

Returns 1 on success, or 0 if an error occurred.

virtual int shutdown ()

Engine calls this function on plugin shutdown.

Return value

Returns 1 on success, or 0 if an error occurred.

virtual void destroy ()

Plugin should contain this function if it directly uses any OpenGL or DirectX commands. It is used to reinitialize the graphics context. Engine calls this function when the video mode is changed or application is restarted (i.e. video_restart is called).

virtual void update ()

Engine calls this function before updating each render frame.

virtual void render ()

Engine calls this function before rendering each render frame.

virtual void gui ()

Engine calls this function before gui each render frame.

virtual void flush ()

Engine calls this function before updating each physics frame.

virtual void swap ()

Engine calls this function before swapping each render frame.

virtual int initWorld ()

Engine calls this function on world initialization.

Return value

Returns 1 on success, or 0 if an error occurred.

virtual int shutdownWorld ()

Engine calls this function on world shutdown.

Return value

Returns 1 on success, or 0 if an error occurred.

virtual int updateWorld ()

Engine calls this function before updating each render frame.

virtual int renderWorld ()

Engine calls this function before rendering each render frame.

virtual int flushWorld ()

Engine calls this function before updating each physics frame.

virtual int loadWorld (const XmlPtr & xml)

Engine calls this function on world loading.

Arguments

  • const XmlPtr & xml - Xml smart pointer.

Return value

Returns 1 on success, or 0 if an error occurred.

virtual int saveWorld (const XmlPtr & xml)

Engine calls this function on world saving.

Arguments

  • const XmlPtr & xml - Xml smart pointer.

Return value

Returns 1 on success, or 0 if an error occurred.

virtual int saveState (const StreamPtr & stream)

Engine calls this function on world saving.

Arguments

  • const StreamPtr & stream - Stream smart pointer.

Return value

Returns 1 on success, or 0 if an error occurred.

virtual int restoreState (const StreamPtr & stream)

Engine calls this function on world restoring.

Arguments

  • const StreamPtr & stream - Stream smart pointer.

Return value

Returns 1 on success, or 0 if an error occurred.
Last update: 2017-07-03
Build: ()