Main controller for the application. More...
#include <controller.h>
Public Member Functions | |
bool | IsActive () const |
absl::Status | OnEntry (std::string filename="") |
void | OnInput () |
absl::Status | OnLoad () |
void | DoRender () const |
void | OnExit () |
void | SetStartupEditor (const std::string &editor_name, const std::string &cards) |
auto | window () -> SDL_Window * |
void | set_active (bool active) |
auto | active () const |
auto | overworld () -> yaze::zelda3::Overworld * |
auto | GetCurrentRom () -> Rom * |
auto | renderer () -> gfx::IRenderer * |
Private Member Functions | |
friend | int::main (int argc, char **argv) |
Private Attributes | |
bool | active_ = false |
core::Window | window_ |
editor::EditorManager | editor_manager_ |
std::unique_ptr< gfx::IRenderer > | renderer_ |
Main controller for the application.
This class is responsible for managing the main window and the main editor. It is the main entry point for the application.
Definition at line 24 of file controller.h.
|
inline |
Definition at line 26 of file controller.h.
References active_.
Referenced by yaze::test::RunIntegrationTest(), and yaze::test::EditorIntegrationTest::RunTest().
absl::Status yaze::core::Controller::OnEntry | ( | std::string | filename = "" | ) |
Definition at line 23 of file controller.cc.
References active_, yaze::core::Window::audio_buffer_, yaze::core::Window::audio_device_, yaze::core::CreateWindow(), editor_manager_, yaze::editor::EditorManager::emulator(), yaze::gfx::Arena::Get(), yaze::editor::EditorManager::Initialize(), yaze::gfx::Arena::Initialize(), renderer_, RETURN_IF_ERROR, and window_.
Referenced by yaze::test::gui::LoadRomInTest().
void yaze::core::Controller::OnInput | ( | ) |
Definition at line 53 of file controller.cc.
References yaze::core::HandleEvents(), PRINT_IF_ERROR, and window_.
Referenced by yaze::test::RunIntegrationTest(), and yaze::test::EditorIntegrationTest::RunTest().
absl::Status yaze::core::Controller::OnLoad | ( | ) |
Definition at line 57 of file controller.cc.
References active_, yaze::core::Window::active_, yaze::gui::DockSpaceRenderer::BeginEnhancedDockSpace(), yaze::gui::WidgetIdRegistry::BeginFrame(), yaze::editor::EditorManager::DrawMenuBar(), editor_manager_, yaze::gui::WidgetIdRegistry::EndFrame(), yaze::gui::WidgetIdRegistry::Instance(), yaze::editor::EditorManager::quit(), RETURN_IF_ERROR, yaze::editor::EditorManager::Update(), and window_.
void yaze::core::Controller::DoRender | ( | ) | const |
Definition at line 102 of file controller.cc.
References yaze::core::TimingManager::Get(), yaze::gfx::Arena::Get(), yaze::gfx::Arena::ProcessTextureQueue(), renderer_, and yaze::core::TimingManager::Update().
Referenced by main(), yaze::test::RunIntegrationTest(), and yaze::test::EditorIntegrationTest::RunTest().
void yaze::core::Controller::OnExit | ( | ) |
Definition at line 123 of file controller.cc.
References PRINT_IF_ERROR, renderer_, yaze::core::ShutdownWindow(), and window_.
Referenced by main(), and yaze::test::RunIntegrationTest().
void yaze::core::Controller::SetStartupEditor | ( | const std::string & | editor_name, |
const std::string & | cards | ||
) |
Definition at line 44 of file controller.cc.
References editor_manager_, and yaze::editor::EditorManager::OpenEditorAndCardsFromFlags().
|
inline |
Definition at line 36 of file controller.h.
References window_, and yaze::core::Window::window_.
Referenced by yaze::test::EditorIntegrationTest::Initialize(), and yaze::test::RunIntegrationTest().
|
inline |
Definition at line 37 of file controller.h.
References active(), and active_.
Referenced by yaze::test::EditorIntegrationTest::Initialize(), and yaze::test::RunIntegrationTest().
|
inline |
|
inline |
Definition at line 39 of file controller.h.
References editor_manager_, and yaze::editor::EditorManager::overworld().
Referenced by E2ETest_CanvasSelectionTest().
|
inline |
Definition at line 42 of file controller.h.
References editor_manager_, and yaze::editor::EditorManager::GetCurrentRom().
|
inline |
Definition at line 43 of file controller.h.
References renderer_.
|
private |
|
private |
Definition at line 48 of file controller.h.
Referenced by active(), IsActive(), OnEntry(), OnLoad(), and set_active().
|
private |
|
private |
Definition at line 50 of file controller.h.
Referenced by GetCurrentRom(), OnEntry(), OnLoad(), overworld(), and SetStartupEditor().
|
private |
Definition at line 51 of file controller.h.
Referenced by DoRender(), OnEntry(), OnExit(), and renderer().