Main controller for the application. More...
#include <controller.h>

Classes | |
| struct | ScreenshotRequest |
Public Member Functions | |
| bool | IsActive () const |
| absl::Status | OnEntry (std::string filename="") |
| void | OnInput () |
| absl::Status | OnLoad () |
| void | DoRender () const |
| void | OnExit () |
| void | RequestScreenshot (const ScreenshotRequest &request) |
| 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 * |
| editor::EditorManager * | editor_manager () |
| platform::IWindowBackend * | window_backend () |
| absl::Status | LoadRomForTesting (const std::string &rom_path) |
Private Member Functions | |
| friend | int::main (int argc, char **argv) |
| void | ProcessScreenshotRequests () const |
Private Attributes | |
| bool | active_ = false |
| std::unique_ptr< platform::IWindowBackend > | window_backend_ |
| editor::EditorManager | editor_manager_ |
| std::unique_ptr< gfx::IRenderer > | renderer_ |
| std::mutex | screenshot_mutex_ |
| std::queue< ScreenshotRequest > | screenshot_requests_ |
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 32 of file controller.h.
|
inline |
Definition at line 39 of file controller.h.
References active_.
| absl::Status yaze::Controller::OnEntry | ( | std::string | filename = "" | ) |
Definition at line 26 of file controller.cc.
References active_, yaze::gfx::RendererFactory::Create(), yaze::platform::WindowBackendFactory::Create(), editor_manager_, yaze::editor::EditorManager::emulator(), yaze::gfx::Arena::Get(), yaze::gfx::RendererFactory::GetDefaultBackendType(), yaze::platform::WindowBackendFactory::GetDefaultType(), yaze::platform::WindowConfig::high_dpi, yaze::editor::EditorManager::Initialize(), yaze::gfx::Arena::Initialize(), yaze::platform::IOS, yaze::gfx::Metal, renderer_, yaze::platform::WindowConfig::resizable, RETURN_IF_ERROR, yaze::platform::WindowConfig::title, and window_backend_.
| void yaze::Controller::OnInput | ( | ) |
Definition at line 82 of file controller.cc.
References active_, yaze::platform::Close, editor_manager_, yaze::editor::EditorManager::emulator(), yaze::platform::WindowEvent::has_native_event, yaze::platform::WindowEvent::native_event, yaze::platform::Quit, yaze::platform::WindowEvent::type, and window_backend_.

| absl::Status yaze::Controller::OnLoad | ( | ) |
Definition at line 106 of file controller.cc.
References active_, yaze::gui::DockSpaceRenderer::BeginEnhancedDockSpace(), yaze::gui::WidgetIdRegistry::BeginFrame(), yaze::editor::EditorManager::DrawMenuBar(), yaze::editor::UICoordinator::DrawMenuBarRestoreButton(), editor_manager_, yaze::gui::DockSpaceRenderer::EndEnhancedDockSpace(), yaze::gui::WidgetIdRegistry::EndFrame(), yaze::editor::EditorManager::GetBottomLayoutOffset(), yaze::editor::EditorManager::GetLeftLayoutOffset(), yaze::editor::EditorManager::GetRightLayoutOffset(), yaze::gui::WidgetIdRegistry::Instance(), yaze::editor::UICoordinator::IsMenuBarVisible(), yaze::editor::EditorManager::quit(), RETURN_IF_ERROR, yaze::editor::EditorManager::ui_coordinator(), yaze::editor::EditorManager::Update(), and window_backend_.
| void yaze::Controller::DoRender | ( | ) | const |
Definition at line 191 of file controller.cc.
References yaze::gfx::Arena::Get(), yaze::TimingManager::Get(), ProcessScreenshotRequests(), yaze::gfx::Arena::ProcessTextureQueue(), renderer_, yaze::TimingManager::Update(), and window_backend_.
| void yaze::Controller::OnExit | ( | ) |
Definition at line 219 of file controller.cc.
References renderer_, and window_backend_.
| void yaze::Controller::RequestScreenshot | ( | const ScreenshotRequest & | request | ) |
Definition at line 237 of file controller.cc.
References screenshot_mutex_, and screenshot_requests_.
| void yaze::Controller::SetStartupEditor | ( | const std::string & | editor_name, |
| const std::string & | cards ) |
Definition at line 73 of file controller.cc.
References editor_manager_, and yaze::editor::EditorManager::OpenEditorAndPanelsFromFlags().

|
inline |
Definition at line 53 of file controller.h.
References window_backend_.
|
inline |
Definition at line 56 of file controller.h.
References active(), and active_.

|
inline |
|
inline |
Definition at line 58 of file controller.h.
References editor_manager_, and yaze::editor::EditorManager::overworld().

|
inline |
Definition at line 61 of file controller.h.
References editor_manager_, and yaze::editor::EditorManager::GetCurrentRom().

|
inline |
Definition at line 62 of file controller.h.
References renderer_.
|
inline |
Definition at line 65 of file controller.h.
References editor_manager_.
Referenced by yaze::app::GetGlobalEditorManager(), and yaze::app::GetGlobalEmulator().
|
inline |
Definition at line 68 of file controller.h.
References window_backend_.
| absl::Status yaze::Controller::LoadRomForTesting | ( | const std::string & | rom_path | ) |
Definition at line 228 of file controller.cc.
References editor_manager_, and yaze::editor::EditorManager::OpenRomOrProject().

|
private |
|
private |
Definition at line 242 of file controller.cc.
References screenshot_mutex_, and screenshot_requests_.
Referenced by DoRender().
|
private |
Definition at line 83 of file controller.h.
Referenced by active(), IsActive(), OnEntry(), OnInput(), OnLoad(), and set_active().
|
private |
Definition at line 84 of file controller.h.
Referenced by DoRender(), OnEntry(), OnExit(), OnInput(), OnLoad(), window(), and window_backend().
|
private |
Definition at line 85 of file controller.h.
Referenced by editor_manager(), GetCurrentRom(), LoadRomForTesting(), OnEntry(), OnInput(), OnLoad(), overworld(), and SetStartupEditor().
|
private |
Definition at line 86 of file controller.h.
Referenced by DoRender(), OnEntry(), OnExit(), and renderer().
|
mutableprivate |
Definition at line 89 of file controller.h.
Referenced by ProcessScreenshotRequests(), and RequestScreenshot().
|
mutableprivate |
Definition at line 90 of file controller.h.
Referenced by ProcessScreenshotRequests(), and RequestScreenshot().