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

60 lines
1.2 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"
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(const char* args, std::vector<LogListener*>& listeners)
{
mpLog = Logger::GetInstance();
for (unsigned i = 0; i < listeners.size(); i++)
{
mpLog->AddListener(listeners[i]);
}
}
bool core::IsInit() const
{
return mbIsInit;
}
const State& core::GetState() const
{
return mState;
}
}