Kohi Game Engine
plugin_types.h File Reference
#include "defines.h"
#include "platform/platform.h"

Go to the source code of this file.

Data Structures

struct  kruntime_plugin
 

Typedefs

typedef b8(* PFN_kruntime_plugin_create) (struct kruntime_plugin *out_plugin)
 
typedef b8(* PFN_kruntime_plugin_boot) (struct kruntime_plugin *plugin)
 
typedef b8(* PFN_kruntime_plugin_initialize) (struct kruntime_plugin *plugin)
 
typedef void(* PFN_kruntime_plugin_destroy) (struct kruntime_plugin *plugin)
 
typedef b8(* PFN_kruntime_plugin_update) (struct kruntime_plugin *plugin, struct frame_data *p_frame_data)
 
typedef b8(* PFN_kruntime_plugin_frame_prepare) (struct kruntime_plugin *plugin, struct frame_data *p_frame_data)
 
typedef b8(* PFN_kruntime_plugin_render) (struct kruntime_plugin *plugin, struct frame_data *p_frame_data)
 
typedef void(* PFN_kruntime_plugin_on_window_resized) (void *plugin_state, struct kwindow *window, u16 width, u16 height)
 
typedef struct kruntime_plugin kruntime_plugin
 

Typedef Documentation

◆ kruntime_plugin

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.

◆ PFN_kruntime_plugin_boot

typedef b8(* PFN_kruntime_plugin_boot) (struct kruntime_plugin *plugin)

◆ PFN_kruntime_plugin_create

typedef b8(* PFN_kruntime_plugin_create) (struct kruntime_plugin *out_plugin)

◆ PFN_kruntime_plugin_destroy

typedef void(* PFN_kruntime_plugin_destroy) (struct kruntime_plugin *plugin)

◆ PFN_kruntime_plugin_frame_prepare

typedef b8(* PFN_kruntime_plugin_frame_prepare) (struct kruntime_plugin *plugin, struct frame_data *p_frame_data)

◆ PFN_kruntime_plugin_initialize

typedef b8(* PFN_kruntime_plugin_initialize) (struct kruntime_plugin *plugin)

◆ PFN_kruntime_plugin_on_window_resized

typedef void(* PFN_kruntime_plugin_on_window_resized) (void *plugin_state, struct kwindow *window, u16 width, u16 height)

◆ PFN_kruntime_plugin_render

typedef b8(* PFN_kruntime_plugin_render) (struct kruntime_plugin *plugin, struct frame_data *p_frame_data)

◆ PFN_kruntime_plugin_update

typedef b8(* PFN_kruntime_plugin_update) (struct kruntime_plugin *plugin, struct frame_data *p_frame_data)