/****************************************************************************** * 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 #include 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; } }