Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDekiInputPackage.cpp
More file actions
Latest commit
111 lines (87 loc) · 2.68 KB
/
Copy pathDekiInputPackage.cpp
File metadata and controls
111 lines (87 loc) · 2.68 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/**
* @file DekiInputPackage.cpp
* @brief Package entry point for deki-input DLL
*
* Exports the standard Deki plugin interface so the editor
* can load deki-input.dll and register its components (InputCollider).
*/
#include"DekiInputPackage.h"
#include"interop/DekiPlugin.h"
#include"InputCollider.h"
#include"DekiInputInit.h"
#include"DekiEngine.h"
#include"reflection/ComponentRegistry.h"
#include"reflection/ComponentFactory.h"
#ifdef DEKI_EDITOR
#ifndef DEKI_PLUGIN_EXPORTS
// Auto-generated registration helpers (standalone DLL only)
externvoidDekiInput_RegisterComponents();
externintDekiInput_GetAutoComponentCount();
externconst DekiComponentMeta* DekiInput_GetAutoComponentMeta(int index);
// Track if already registered to avoid duplicates
staticbool s_InputRegistered = false;
extern"C" {
/**
* @brief Ensure deki-input package is loaded and components are registered
*/
DEKI_INPUT_APIintDekiInput_EnsureRegistered(void)
{
if (s_InputRegistered)
returnDekiInput_GetAutoComponentCount();
s_InputRegistered = true;
DekiInput_RegisterComponents();
// Initialize input system (idempotent — may already be initialized
// by deki_init_package_systems() during DekiEngine::Initialize())
DekiInput_InitSystem();
returnDekiInput_GetAutoComponentCount();
}
} // extern "C"
#endif// DEKI_PLUGIN_EXPORTS
// =============================================================================
// Plugin metadata (for dynamic loading compatibility)
// =============================================================================
extern"C" {
#ifndef DEKI_PLUGIN_EXPORTS
DEKI_PLUGIN_APIconstchar* DekiPlugin_GetName(void)
{
return"Deki Input Package";
}
DEKI_PLUGIN_APIconstchar* DekiPlugin_GetVersion(void)
{
#ifdef DEKI_PACKAGE_VERSION
returnDEKI_PACKAGE_VERSION;
#else
return"0.0.0-dev";
#endif
}
DEKI_PLUGIN_APIintDekiPlugin_Init(void)
{
return0;
}
DEKI_PLUGIN_APIvoidDekiPlugin_Shutdown(void)
{
DekiInput_ShutdownSystem();
s_InputRegistered = false;
}
DEKI_PLUGIN_APIintDekiPlugin_GetComponentCount(void)
{
returnDekiInput_GetAutoComponentCount();
}
DEKI_PLUGIN_APIconst DekiComponentMeta* DekiPlugin_GetComponentMeta(int index)
{
returnDekiInput_GetAutoComponentMeta(index);
}
DEKI_PLUGIN_APIvoidDekiPlugin_RegisterComponents(void)
{
DekiInput_EnsureRegistered();
}
#endif// DEKI_PLUGIN_EXPORTS
// =============================================================================
// Package-specific feature API
// =============================================================================
DEKI_INPUT_APIconstchar* DekiInput_GetName(void)
{
return"Input";
}
} // extern "C"
#endif// DEKI_EDITOR