aboutsummaryrefslogtreecommitdiff
path: root/primedev/plugins/pluginmanager.h
diff options
context:
space:
mode:
Diffstat (limited to 'primedev/plugins/pluginmanager.h')
-rw-r--r--primedev/plugins/pluginmanager.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/primedev/plugins/pluginmanager.h b/primedev/plugins/pluginmanager.h
new file mode 100644
index 00000000..8c021851
--- /dev/null
+++ b/primedev/plugins/pluginmanager.h
@@ -0,0 +1,33 @@
+#ifndef PLUGIN_MANAGER_H
+#define PLUGIN_MANAGER_H
+
+#include <windows.h>
+
+class Plugin;
+
+class PluginManager
+{
+public:
+ const std::vector<Plugin>& GetLoadedPlugins() const;
+ const std::optional<Plugin> GetPlugin(HMODULE handle) const;
+ bool LoadPlugins(bool reloaded = false);
+ void LoadPlugin(fs::path path, bool reloaded = false);
+ void ReloadPlugins();
+ void RemovePlugin(HMODULE handle);
+
+ // callback triggers
+ void InformSqvmCreated(CSquirrelVM* sqvm) const;
+ void InformSqvmDestroying(CSquirrelVM* sqvm) const;
+ void InformDllLoad(HMODULE module, fs::path path) const;
+ void RunFrame() const;
+
+private:
+ void InformAllPluginsInitialized() const;
+
+ std::vector<Plugin> plugins;
+ std::string pluginPath;
+};
+
+extern PluginManager* g_pPluginManager;
+
+#endif