|
Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
|
Plugins may contain their own components, managers, systems, and implementations of various interfaces, as well as editor tools. But the engine will not know about them unless the plugin announces them to the engine. This is done through a registration process.
Plugins are shared libraries (.dll, .so, etc.) that are found in the bin directory. Plugins have two functions that allow them to integrate with the engine:
These functions allow the plugin to register and unregister important functionality with the engine. By convention, they are usually stored in an EntryPoint.cpp file.
This may not be up to date - it's best to check the official PluginInterface instead.
These are used for getting core functional things from the EngineCore, to be used in setters for globals usually.
| Register Function | Unregister Function | Description |
|---|---|---|
| RegisterSystem | UnregisterSystem | Systems are registered in the SystemRegistrar. They are functions that run every tick. |
| RegisterEditorSystem | UnregisterEditorSystem | Editor Systems are registered in the SystemRegistrar They are functions that run every tick in the editor only. |
| RegisterAssetRenderer | UnregisterAssetRenderer | AssetRenderer are registered in the AssetRendererManager. They are used to render specific types of assets such as Mesh3dRenderer and SkeletalMeshRenderer. |
| RegisterAssetType | UnregisterAssetType | AssetType are registered in the AssetManager. Check out Asset System for more information. |
| RegisterAssetType<T> | UnregisterAssetType<T> | Same as above but used as a template. For example, you can RegisterAssetType<Grindstone::Mesh3dAsset>(). |
| RegisterWorldContextFactory | UnregisterWorldContextFactory | Systems are registered in the WorldContextManager |
| RegisterWorldContextFactory<T> | UnregisterWorldContextFactory<T> | Same as above but used as a template. For example, you can RegisterWorldContextFactory<Grindstone::Physics::WorldContext>(physicsWorldContextName) |
| RegisterComponent<T> | UnregisterComponent<T> | Components are registered in the ComponentRegistrar. Components are data that can be attached to entities, and can be referenced in Systems. |
| Register Function | Unregister Function | Description |
|---|---|---|
| RegisterAssetImporter | DeregisterAssetImporter | ImporterData take a source resource file, and outputs assets based on it. |
| MapExtensionToImporterType | UnmapExtensionToImporterType | Maps some extension (i.e.: .wav) to an AssetImporter, (i.e.: AudioImporter). |
| RegisterAssetTemplate | DeregisterAssetTemplate | Allows a user to create a default asset that can be created in the AssetBrowser. |
| RegisterThumbnailGenerator | DeregisterThumbnailGenerator | Registers an AssetThumbnailGenerator that takes the UUID of the asset, and generates a thumbnail image to be shown in the AssetBrowser. |
| RegisterMenuItem | DeregisterMenuItem | Links a menu item path (i.e.: Edit/Baking/Lighting) and a shortcut (i.e.: Ctrl+Alt+L) to a function to do an action. |
| RegisterProjectSettingsPage | DeregisterProjectSettingsPage | Registers a settings page with a display name and a factory function. |
The main plugin interface provides a means of getting core systems to set as globals (such as the logger and allocator), and register custom components, asset types, and systems among other things.
While custom tools (and games) may provide their own child classes of PluginInterface, Grindstone has an official EditorPluginInterface. Here is an example of an editor-specific plugin, and how we can register an importer for an asset.