[Feat] (All): Implement init, log and other related components.

This commit is contained in:
BZLZHH
2025-07-11 18:09:45 +08:00
parent 0eed6f17a2
commit b76c23429f
6 changed files with 279 additions and 2 deletions
+42
View File
@@ -0,0 +1,42 @@
#include "Includes.h"
namespace MobileGL {
void MG_Initialize() {
MG_Util::Debug::InitFile();
MGLOG_I("MobileGL Initializing...");
}
void MG_Destroy() {
MGLOG_I("MobileGL Closing...");
MG_Util::Debug::Close();
}
#if defined(__linux__) || defined(__APPLE__)
__attribute__((constructor)) static void AutoInit() {
MG_Initialize();
}
__attribute__((destructor)) static void AutoDestroy() {
MG_Destroy();
}
#endif
#ifdef _WIN32
BOOL WINAPI DllMain(HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
MG_Initialize();
break;
case DLL_PROCESS_DETACH:
MG_Destroy();
break;
}
return TRUE;
}
#endif
}