summaryrefslogtreecommitdiff
path: root/src/plugin-types.hpp
blob: 22f970770443ab635568b46fbbbbe519bde2150c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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 */