Kohi Game Engine
|
#include <plugin_types.h>
Data Fields | |
const char * | name |
The plugin's name. Just for display, really. Serves no purpose. More... | |
const char * | config_str |
The plugin's configuration in string format. More... | |
dynamic_library | library |
The dynamically loaded library for the plugin. More... | |
PFN_kruntime_plugin_boot | kplugin_boot |
A pointer to the plugin's kplugin_boot function. Optional. This function is for plugins which require boot-time setup (i.e the renderer). If exists, this is invoked at boot time. More... | |
PFN_kruntime_plugin_initialize | kplugin_initialize |
A pointer to the plugin's kplugin_initialize function. Optional. If exists, this is invoked post-boot-time. More... | |
PFN_kruntime_plugin_destroy | kplugin_destroy |
A pointer to the plugin's kplugin_destroy function. Required. More... | |
PFN_kruntime_plugin_update | kplugin_update |
A function pointer for the plugin's hook into the update loop. Optional. More... | |
PFN_kruntime_plugin_frame_prepare | kplugin_frame_prepare |
A function pointer for the plugin's hook into the frame_prepare stage. Optional. More... | |
PFN_kruntime_plugin_render | kplugin_render |
A function pointer for the plugin's hook into the render loop. Optional. More... | |
PFN_kruntime_plugin_on_window_resized | kplugin_on_window_resized |
A function pointer for the plugin's hook into the window resize event. Optional. More... | |
u64 | plugin_state_size |
The size of the plugin's internal state. More... | |
void * | plugin_state |
The block of memory holding the plugin's internal state. More... | |
A generic structure to hold function pointers for a given plugin. These serve as the plugin's hook into the system at various points of its lifecycle. Only the 'create' and 'destroy' are required, all others are optional. Also note that the "create" isn't saved because it is only called the first time the plugin is loaded.
NOTE: There must be an exported function named the same as each parameter for it to get picked up automatically. For example, the "vulkan renderer" plugin must have an exported function called "kplugin_create". This is automatically found via dynamic linking by name, and thus the names must match to facilitate automatic linking.
const char* config_str |
The plugin's configuration in string format.
PFN_kruntime_plugin_boot kplugin_boot |
A pointer to the plugin's kplugin_boot
function. Optional. This function is for plugins which require boot-time setup (i.e the renderer). If exists, this is invoked at boot time.
PFN_kruntime_plugin_destroy kplugin_destroy |
A pointer to the plugin's kplugin_destroy
function. Required.
PFN_kruntime_plugin_frame_prepare kplugin_frame_prepare |
A function pointer for the plugin's hook into the frame_prepare stage. Optional.
PFN_kruntime_plugin_initialize kplugin_initialize |
A pointer to the plugin's kplugin_initialize
function. Optional. If exists, this is invoked post-boot-time.
PFN_kruntime_plugin_on_window_resized kplugin_on_window_resized |
A function pointer for the plugin's hook into the window resize event. Optional.
PFN_kruntime_plugin_render kplugin_render |
A function pointer for the plugin's hook into the render loop. Optional.
PFN_kruntime_plugin_update kplugin_update |
A function pointer for the plugin's hook into the update loop. Optional.
dynamic_library library |
The dynamically loaded library for the plugin.
const char* name |
The plugin's name. Just for display, really. Serves no purpose.
void* plugin_state |
The block of memory holding the plugin's internal state.
u64 plugin_state_size |
The size of the plugin's internal state.