Skip to content

Commit

Permalink
xrGame: add initialize library while dll loading under linux
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg committed Oct 5, 2018
1 parent d33ddea commit 1b5bf40
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/xrGame/xrGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,25 @@ BOOL APIENTRY DllMain(HANDLE hModule, u32 ul_reason_for_call, LPVOID lpReserved)
}
return (TRUE);
}
#else
__attribute__((constructor))
static void load(int argc, char** argv, char** envp)
{
// Fill ui style token
FillUIStyleToken();
// register console commands
CCC_RegisterCommands();
// keyboard binding
CCC_RegisterInput();
#ifdef DEBUG
// XXX nitrocaster PROFILER: temporarily disabled due to linkage issues
// g_profiler = new CProfiler();
#endif
}

__attribute__((destructor))
static void unload()
{
CleanupUIStyleToken();
}
#endif

0 comments on commit 1b5bf40

Please sign in to comment.