mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 04:08:32 +09:00
[Feat] (All): Implement init, log and other related components.
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user