aboutsummaryrefslogtreecommitdiff
path: root/primedev/plugins/interfaces/IPluginCallbacks.h
diff options
context:
space:
mode:
Diffstat (limited to 'primedev/plugins/interfaces/IPluginCallbacks.h')
-rw-r--r--primedev/plugins/interfaces/IPluginCallbacks.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/primedev/plugins/interfaces/IPluginCallbacks.h b/primedev/plugins/interfaces/IPluginCallbacks.h
new file mode 100644
index 00000000..c02ce8a6
--- /dev/null
+++ b/primedev/plugins/interfaces/IPluginCallbacks.h
@@ -0,0 +1,36 @@
+#ifndef IPLUGIN_CALLBACKS_H
+#define IPLUGIN_CALLBACKS_H
+
+#include <windows.h>
+#include <stdint.h>
+#include "squirrel/squirrel.h"
+
+// can't use bitwise ops on enum classes but I don't want these in the global namespace (user defined operators suck)
+namespace PluginContext
+{
+ enum : uint64_t
+ {
+ DEDICATED = 0x1,
+ CLIENT = 0x2,
+ };
+}
+
+struct PluginNorthstarData
+{
+ HMODULE pluginHandle;
+};
+
+class IPluginCallbacks
+{
+public:
+ virtual void
+ Init(HMODULE northstarModule, const PluginNorthstarData* initData, bool reloaded) = 0; // runs after the plugin is loaded and validated
+ virtual void Finalize() = 0; // runs after all plugins have been loaded
+ virtual bool Unload() = 0; // runs just before the library is freed
+ virtual void OnSqvmCreated(CSquirrelVM* sqvm) = 0;
+ virtual void OnSqvmDestroying(CSquirrelVM* sqvm) = 0;
+ virtual void OnLibraryLoaded(HMODULE module, const char* name) = 0;
+ virtual void RunFrame() = 0;
+};
+
+#endif