aboutsummaryrefslogtreecommitdiff
path: root/primedev/plugins/pluginmanager.h
blob: 8c021851092b0591044279e58ed2f5cba9bc09e6 (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
26
27
28
29
30
31
32
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