You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lunarium_OLD/src/core/core.cpp

63 lines
1.3 KiB
C++

/******************************************************************************
* File - core.cpp
* Author - Joey Pollack
* Date - 2021/08/30 (y/m/d)
* Mod Date - 2021/08/30 (y/m/d)
* Description - The Core Engine Class. Manages the engine components.
******************************************************************************/
#include "core.h"
#include "Version.h"
namespace lunarium
{
Core* Core::mpInstance = nullptr;
Core::Core()
: mbIsInit(false)
{
}
Core& Core::GetInstance()
{
if (!mpInstance)
{
mpInstance = new Core;
}
return *mpInstance;
}
void Core::Shutdown()
{
if (!mpInstance)
return;
// Shutdown subsystems
delete mpInstance;
mpInstance = nullptr;
}
void Core::Initialize(int argc, char** argv, std::vector<LogListener*>& listeners)
{
mpLog = Logger::GetInstance();
for (unsigned i = 0; i < listeners.size(); i++)
{
mpLog->AddListener(listeners[i]);
}
mpLog->Log(LogCategory::CORE, LogLevel::INFO, "Running Lunarium version %s", Version::GetVersion().ToString().c_str());
}
bool Core::IsInit() const
{
return mbIsInit;
}
const State& Core::GetState() const
{
return mState;
}
}