The comfortable framework for making games in Wren
The plugin
module is the gateway to loading native plugins which can access lower level system features, or bind to other shared libraries.
static load(name: String): Void
This will search the current execution context for a plugin of the given name
and load it.
The name of the library must be as follows, for different platforms. Assuming your plugin was named "test"
:
test.dll
test.dylib
test.so
The name
can be treated as a relative file path from the location of your application entry point, but it is recommended to place plugin library files in the same folder as your main.wren
or game.egg
file, for the best compatibility across platforms.
Once the plugin library is loaded, DOME will execute its Init hook, if available. If the hook reports a failure, or the library could not be found, Plugin.load()
will abort the current fiber.
A plugin is not unloaded until DOME shuts down. There is no way to unload it during execution.