Skip to content

Commit 1b5bf40

Browse files
committed
xrGame: add initialize library while dll loading under linux
1 parent d33ddea commit 1b5bf40

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/xrGame/xrGame.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,25 @@ BOOL APIENTRY DllMain(HANDLE hModule, u32 ul_reason_for_call, LPVOID lpReserved)
6161
}
6262
return (TRUE);
6363
}
64+
#else
65+
__attribute__((constructor))
66+
static void load(int argc, char** argv, char** envp)
67+
{
68+
// Fill ui style token
69+
FillUIStyleToken();
70+
// register console commands
71+
CCC_RegisterCommands();
72+
// keyboard binding
73+
CCC_RegisterInput();
74+
#ifdef DEBUG
75+
// XXX nitrocaster PROFILER: temporarily disabled due to linkage issues
76+
// g_profiler = new CProfiler();
77+
#endif
78+
}
79+
80+
__attribute__((destructor))
81+
static void unload()
82+
{
83+
CleanupUIStyleToken();
84+
}
6485
#endif

0 commit comments

Comments
 (0)