Class defining a generic OGRE plugin.
- Plugins can be linked statically or dynamically. If they are linked dynamically (ie the plugin is in a DLL or Shared Object file), then you load the plugin by calling the Root::loadPlugin method (or some other mechanism which leads to that call, e.g. plugins.cfg), passing the name of the DLL. OGRE will then call a global init function on that DLL, and it will be expected to register one or more Plugin implementations using Root::installPlugin. The procedure is very similar if you use a static linked plugin, except that you simply instantiate the Plugin implementation yourself and pass it to Root::installPlugin.
- Note
- Lifecycle of a Plugin instance is very important. The Plugin instance must remain valid until the Plugin is uninstalled. Here are the things you must bear in mind:
-
If your plugin is in a DLL:
-
If your plugin is statically linked in your app:
The install and uninstall methods will be called when the plugin is installed or uninstalled. The initialise and shutdown will be called when there is a system initialisation or shutdown, e.g. when Root::initialise or Root::shutdown are called.