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/run_modes/editor/editor.cpp

64 lines
1.4 KiB
C++

/******************************************************************************
* File - editor.cpp
* Author - Joey Pollack
* Date - 2021/11/01 (y/m/d)
* Mod Date - 2021/11/01 (y/m/d)
* Description - Entry point for the editor run mode.
******************************************************************************/
#include "editor.h"
#include "panels/mainPanel.h"
#include <core/core.h>
#include <utils/logger.h>
namespace lunarium
{
Editor::Editor()
: mLogCat(-1), mpMainPanel(nullptr)
{
}
OpRes Editor::Initialize()
{
//Core::MainWindow().Hide();
mLogCat = Logger::RegisterCategory("EDITOR");
mpMainPanel = &MainPanel::GetInstance();
mpMainPanel->SetEditor(this);
return OpRes::OK();
}
void Editor::Shutdown()
{
MainPanel::FreeInstance();
}
void Editor::OnTick(double delta)
{
int x, y, w, h;
mpMainPanel->GetPosition(x, y);
mpMainPanel->GetSize(w, h);
if (w > 0 && h > 0)
{
// NOTE TODO: Hardcoding fullscreen to false!
Core::MainWindow().ChangeDisplayMode(false, x, y, w, h);
}
}
void Editor::OnRender(IGraphics* g)
{
if (!mpMainPanel->DoFrame())
{
Core::GetInstance().SignalShutdown();
}
}
uint32_t Editor::GetLogCat() const
{
return mLogCat;
}
}