116 lines
2.4 KiB
C++
116 lines
2.4 KiB
C++
/***
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: Entrypoint.cpp
|
|
Date: 2021-5-13
|
|
Author: Reece
|
|
***/
|
|
#define _AURORA_RUNTIME_BUILD_API_INTERFACES
|
|
#include <AuroraCommon.hpp>
|
|
#include <AuroraRuntime.hpp>
|
|
#include "RuntimeInternal.hpp"
|
|
#include "Crypto.hpp"
|
|
#include "Processes/Processes.hpp"
|
|
#include "RNG/RNG.hpp"
|
|
#include "Locale/Locale.hpp"
|
|
#include "Console/Console.hpp"
|
|
#include "IO/FS/FS.hpp"
|
|
#include "Hashing/Hashing.hpp"
|
|
#include "Debug/Debug.hpp"
|
|
#include "Async/Async.hpp"
|
|
#include "HWInfo/HWInfo.hpp"
|
|
#include "Telemetry/Telemetry.hpp"
|
|
#include "Threading/Threads/OSThread.hpp"
|
|
#include "SWInfo/SWInfo.hpp"
|
|
#if defined(AURORA_PLATFORM_WIN32)
|
|
#include "Extensions/Win32/DarkTheme.hpp"
|
|
#endif
|
|
#include "Process/ProcessMap.hpp"
|
|
|
|
static void Init()
|
|
{
|
|
#if defined(AURORA_PLATFORM_WIN32)
|
|
Aurora::Extensions::Win32::InitDarkMode();
|
|
#endif
|
|
|
|
Crypto::InitCrypto();
|
|
Aurora::Threading::Threads::InitThreading();
|
|
Aurora::Console::Init();
|
|
Aurora::IO::FS::InitResources();
|
|
Aurora::Console::Init2();
|
|
Aurora::Debug::InitDebug();
|
|
Aurora::Locale::Init();
|
|
Aurora::Processes::Init();
|
|
Aurora::RNG::Init();
|
|
Aurora::Hashing::InitHashing();
|
|
Aurora::Async::InitAsync();
|
|
Aurora::SWInfo::InitSwInfo();
|
|
Aurora::HWInfo::Init();
|
|
Aurora::Telemetry::Init();
|
|
Aurora::Process::InitProcessMap();
|
|
}
|
|
|
|
static void Pump()
|
|
{
|
|
Aurora::Console::Pump();
|
|
}
|
|
|
|
static void Deinit()
|
|
{
|
|
Aurora::RNG::Release();
|
|
Aurora::Async::ShutdownAsync();
|
|
Aurora::Console::Exit();
|
|
Aurora::Processes::Deinit();
|
|
}
|
|
|
|
namespace Aurora
|
|
{
|
|
static bool gRuntimeHasStarted {};
|
|
|
|
AUKN_SYM void RuntimeStart(const RuntimeStartInfo &info)
|
|
{
|
|
gRuntimeConfig = info;
|
|
try
|
|
{
|
|
Init();
|
|
}
|
|
catch (...)
|
|
{
|
|
SysPanic("A fatal error occurred during the initialization of Aurora Runtime");
|
|
}
|
|
gRuntimeHasStarted = true;
|
|
}
|
|
|
|
AUKN_SYM void RuntimeShutdown()
|
|
{
|
|
gRuntimeHasStarted = false;
|
|
Deinit();
|
|
}
|
|
|
|
AUKN_SYM void RuntimeSysPump()
|
|
{
|
|
Pump();
|
|
}
|
|
|
|
AUKN_SYM bool RuntimeHasStarted()
|
|
{
|
|
return gRuntimeHasStarted;
|
|
}
|
|
}
|
|
|
|
#if defined(AURORA_PLATFORM_WIN32)
|
|
|
|
BOOL WINAPI DllMain(
|
|
HINSTANCE hinstDLL,
|
|
DWORD fdwReason,
|
|
LPVOID lpReserved)
|
|
{
|
|
if (fdwReason == DLL_PROCESS_ATTACH)
|
|
{
|
|
DisableThreadLibraryCalls(hinstDLL);
|
|
}
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
#endif |