#ifndef PKE_PLUGIN_TYPES_HPP #define PKE_PLUGIN_TYPES_HPP #include #include constexpr int64_t CallbackSignatureLength = 16; using CallbackSignature = char[CallbackSignatureLength]; typedef void (*DeserializeDelegate)(std::istream *stream); typedef void (*SerializeDelegate)(std::istream *stream); typedef void (*CollisionDelegate)(const void *entHandleLeft, const void *entHandleRight); struct PkeEntityTypeInterface { void (*OnDeserialize)(std::ifstream *stream) = nullptr; void (*OnSerialize)(std::ostringstream *stream, void *obj) = nullptr; void (*OnEntityTypeCollision)(const void *entHandleLeft, const void *entHandleRight) = nullptr; void (*OnEntityInstanceCollision)(const void *entHandleLeft, const void *entHandleRight) = nullptr; }; struct PKEPluginInterface { // for internal use only void *pluginHandle = nullptr; void (*OnInit)() = nullptr; void (*OnTick)(double delta) = nullptr; void (*OnTeardown)() = nullptr; void (*OnImGuiRender)() = nullptr; void *PkeEntityInterface = nullptr; std::size_t PkeEntityInterfaceCount = 0; }; 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 */