diff options
Diffstat (limited to 'src/plugin-types.hpp')
| -rw-r--r-- | src/plugin-types.hpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/plugin-types.hpp b/src/plugin-types.hpp new file mode 100644 index 0000000..22f9707 --- /dev/null +++ b/src/plugin-types.hpp @@ -0,0 +1,25 @@ +#ifndef PKE_PLUGIN_TYPES_HPP +#define PKE_PLUGIN_TYPES_HPP + +#include <cstdint> + +struct PKEPluginInterface { + // for internal use only + void *pluginHandle = nullptr; + void (*OnInit)() = nullptr; + void (*OnTick)(double delta) = nullptr; + void (*OnTeardown)() = nullptr; + void (*OnImGuiRender)() = nullptr; +}; + +constexpr int64_t CallbackSignatureLength = 16; +using CallbackSignature = char[CallbackSignatureLength]; + +struct PkeCallback { + // the 16 char signature(name) of a function + CallbackSignature name = {'\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0'}; + // the address of the function to call - populated on startup + void *func = nullptr; +}; + +#endif /* PKE_PLUGIN_TYPES_HPP */ |
