-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.h
32 lines (25 loc) · 789 Bytes
/
plugin.h
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
// plugin.h
#pragma once
// extern "C" tells the C++ compiler to use C linkage for the specified function(s),
// meaning the names will not be mangled and will be treated like regular C functions.
// This is important in scenarios where you need to interact with C libraries,
// dynamically load functions by their unmangled name,
// or expose functions from C++ libraries to C or C-compatible systems.
#include "IPlugin.h"
namespace PluginNamespace
{
class Plugin : public Engine::IPlugin
{
public:
Plugin() = default;
~Plugin() override = default;
void onLoad() override;
void onUnload() override;
void execute() override;
};
// Factory function for creating a plugin instance
extern "C"
{
Engine::IPlugin* createPlugin();
}
} // namespace PluginNamespace