Kohi Game Engine
kruntime_plugin Struct Reference

#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...
 

Detailed Description

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.

Field Documentation

◆ config_str

const char* config_str

The plugin's configuration in string format.

◆ 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.

◆ kplugin_destroy

PFN_kruntime_plugin_destroy kplugin_destroy

A pointer to the plugin's kplugin_destroy function. Required.

◆ kplugin_frame_prepare

PFN_kruntime_plugin_frame_prepare kplugin_frame_prepare

A function pointer for the plugin's hook into the frame_prepare stage. Optional.

◆ kplugin_initialize

PFN_kruntime_plugin_initialize kplugin_initialize

A pointer to the plugin's kplugin_initialize function. Optional. If exists, this is invoked post-boot-time.

◆ kplugin_on_window_resized

PFN_kruntime_plugin_on_window_resized kplugin_on_window_resized

A function pointer for the plugin's hook into the window resize event. Optional.

◆ kplugin_render

A function pointer for the plugin's hook into the render loop. Optional.

◆ kplugin_update

A function pointer for the plugin's hook into the update loop. Optional.

◆ library

dynamic_library library

The dynamically loaded library for the plugin.

◆ name

const char* name

The plugin's name. Just for display, really. Serves no purpose.

◆ plugin_state

void* plugin_state

The block of memory holding the plugin's internal state.

◆ plugin_state_size

u64 plugin_state_size

The size of the plugin's internal state.


The documentation for this struct was generated from the following file: