-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdllmain.cpp
51 lines (46 loc) · 990 Bytes
/
dllmain.cpp
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files
#ifdef _WIN32
#include <windows.h>
#endif
#include <imgui/imgui.h>
#include "Shadertoy.h"
#ifdef WIN32
# define FEXPORT __declspec(dllexport)
#else
# define FEXPORT // empty
#endif
extern "C" {
FEXPORT st::Shadertoy* CreatePlugin() {
return new st::Shadertoy();
}
FEXPORT void DestroyPlugin(st::Shadertoy* ptr) {
delete ptr;
}
FEXPORT int GetPluginAPIVersion() {
return 3;
}
FEXPORT int GetPluginVersion() {
return 1;
}
FEXPORT const char* GetPluginName() {
return "Shadertoy";
}
}
#ifdef _WIN32
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
#endif