All available plugins will be loaded automatically by Hollywood upon startup. However, not all
plugins will be initialized automatically. Some plugin types will only be initialized
if the user explicitly calls @REQUIRE
on them. The reason for this is simple: Some
plugin types can completely replace core components of Hollywood like the inbuilt display or audio
driver. It would not make any sense to activate these plugins automatically upon startup because
it could happen then that several plugins try to replace the same core component and it would also make it
impossible to revert to Hollywood's inbuilt drivers. That's the reason why certain plugin types are
only initialized if explicitly demanded by the user by calling @REQUIRE
on them. Other
plugin types, however, like loaders and savers for additional file formats are normally initialized automatically
so that they are immediately available to all Hollywood applications right after their installation.
Starting with Hollywood 6.0 it is possible to prevent automatic initialization of image, animation,
sound, and video loader plugins using extension flags.
If you want to write a plugin that requires manual initialization, you need to set the HWPLUG_CAPS_REQUIRE
capability flag in your InitPlugin() implementation. Hollywood will then call your plugin
whenever the user runs the @REQUIRE
preprocessor command on your plugin. You will then be able to
perform all necessary initialization in your implementation of the RequirePlugin() call.
Here's a brief overview which plugin types are automatically initialized and which plugin types have to be manually initialized from your RequirePlugin() function:
HWPLUG_CAPS_CONVERT
HWPLUG_CAPS_LIBRARY
HWEXT_LIBRARY_NOAUTOINIT
extension bit.
HWPLUG_CAPS_IMAGE
HWEXT_IMAGE_NOAUTOINIT
extension bit.
HWPLUG_CAPS_ANIM
HWEXT_ANIM_NOAUTOINIT
extension bit.
HWPLUG_CAPS_SOUND
HWEXT_SOUND_NOAUTOINIT
extension bit.
HWPLUG_CAPS_VECTOR
SetVectorEngine()
manually to make Hollywood's vectorgraphics
library use the plugin.
HWPLUG_CAPS_VIDEO
HWEXT_VIDEO_NOAUTOINIT
extension bit.
HWPLUG_CAPS_SAVEIMAGE
HWPLUG_CAPS_SAVEANIM
HWPLUG_CAPS_SAVESAMPLE
HWPLUG_CAPS_REQUIRE
HWPLUG_CAPS_DISPLAYADAPTER
HWPLUG_CAPS_TIMERADAPTER
HWPLUG_CAPS_REQUESTERADAPTER
HWPLUG_CAPS_FILEADAPTER
HWPLUG_CAPS_DIRADAPTER
HWPLUG_CAPS_AUDIOADAPTER
HWPLUG_CAPS_EXTENSION
HWPLUG_CAPS_NETWORKADAPTER
HWPLUG_CAPS_SERIALIZE
HWPLUG_CAPS_ICON
HWEXT_ICON_NOAUTOINIT
extension bit.
HWPLUG_CAPS_SAVEICON
HWPLUG_CAPS_IPCADAPTER
HWPLUG_CAPS_FONT
HWEXT_FONT_NOAUTOINIT
extension bit.
HWPLUG_CAPS_FILESYSADAPTER
You will normally call the functions listed above in your RequirePlugin() implementation. See RequirePlugin for details.
Some plugin types only support the initialization of a single plugin, e.g. it is not possible to have multiple display adapter plugins running. Only a single display adapter can be active at a time. Thus, only the first call to hw_SetDisplayAdapter() will succeed. All other attempts to install another display adapter will fail once a plugin has installed a custom display adapter.