yaze 0.2.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::core::Controller Class Reference

Main controller for the application. More...

#include <controller.h>

Collaboration diagram for yaze::core::Controller:

Public Member Functions

bool IsActive () const
 
absl::Status OnEntry (std::string filename="")
 
void Initialize (std::string filename="")
 
void OnInput ()
 
absl::Status OnLoad ()
 
void DoRender () const
 
void OnExit ()
 
absl::Status CreateWindow ()
 
absl::Status CreateRenderer ()
 
absl::Status CreateGuiContext ()
 
absl::Status LoadConfigFiles ()
 
auto window () -> SDL_Window *
 
void set_active (bool active)
 
auto active () const
 

Private Member Functions

friend int::main (int argc, char **argv)
 

Private Attributes

bool active_ = false
 
editor::EditorManager editor_manager_
 
std::shared_ptr< SDL_Window > window_
 
core::PlatformBackend< Sdl2Backendbackend_
 

Detailed Description

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 29 of file controller.h.

Member Function Documentation

◆ IsActive()

bool yaze::core::Controller::IsActive ( ) const
inline

Definition at line 31 of file controller.h.

References active_.

Referenced by yaze::test::RunIntegrationTest().

◆ OnEntry()

absl::Status yaze::core::Controller::OnEntry ( std::string filename = "")

Definition at line 44 of file controller.cc.

References backend_, CreateGuiContext(), CreateRenderer(), CreateWindow(), editor_manager_, Initialize(), and RETURN_IF_ERROR.

Here is the call graph for this function:

◆ Initialize()

void yaze::core::Controller::Initialize ( std::string filename = "")

Definition at line 58 of file controller.cc.

References active_, and editor_manager_.

Referenced by OnEntry().

◆ OnInput()

void yaze::core::Controller::OnInput ( )

Definition at line 63 of file controller.cc.

References active_.

Referenced by yaze::test::RunIntegrationTest().

◆ OnLoad()

absl::Status yaze::core::Controller::OnLoad ( )

Definition at line 110 of file controller.cc.

References active_, editor_manager_, and RETURN_IF_ERROR.

◆ DoRender()

void yaze::core::Controller::DoRender ( ) const

Definition at line 150 of file controller.cc.

References yaze::core::Renderer::GetInstance().

Referenced by yaze::test::RunIntegrationTest().

Here is the call graph for this function:

◆ OnExit()

void yaze::core::Controller::OnExit ( )

Definition at line 158 of file controller.cc.

References backend_.

Referenced by yaze::test::RunIntegrationTest().

◆ CreateWindow()

absl::Status yaze::core::Controller::CreateWindow ( )

Definition at line 166 of file controller.cc.

References window_.

Referenced by OnEntry(), and yaze::test::RunIntegrationTest().

◆ CreateRenderer()

absl::Status yaze::core::Controller::CreateRenderer ( )

Definition at line 195 of file controller.cc.

References yaze::core::Renderer::CreateRenderer(), yaze::core::Renderer::GetInstance(), and window_.

Referenced by OnEntry(), and yaze::test::RunIntegrationTest().

Here is the call graph for this function:

◆ CreateGuiContext()

absl::Status yaze::core::Controller::CreateGuiContext ( )

Definition at line 199 of file controller.cc.

References backend_, yaze::gui::ColorsYaze(), yaze::core::Renderer::GetInstance(), yaze::core::LoadPackageFonts(), RETURN_IF_ERROR, and window_.

Referenced by OnEntry().

Here is the call graph for this function:

◆ LoadConfigFiles()

absl::Status yaze::core::Controller::LoadConfigFiles ( )

Definition at line 223 of file controller.cc.

References yaze::core::GetConfigDirectory().

Here is the call graph for this function:

◆ window()

auto yaze::core::Controller::window ( ) -> SDL_Window *
inline

Definition at line 44 of file controller.h.

References window_.

Referenced by yaze::test::RunIntegrationTest().

◆ set_active()

void yaze::core::Controller::set_active ( bool active)
inline

Definition at line 45 of file controller.h.

References active(), and active_.

Referenced by yaze::test::RunIntegrationTest().

Here is the call graph for this function:

◆ active()

auto yaze::core::Controller::active ( ) const
inline

Definition at line 46 of file controller.h.

References active_.

Referenced by set_active().

◆ int::main()

yaze::core::Controller::int::main ( int argc,
char ** argv )
private

Member Data Documentation

◆ active_

bool yaze::core::Controller::active_ = false
private

Definition at line 51 of file controller.h.

Referenced by active(), Initialize(), IsActive(), OnInput(), OnLoad(), and set_active().

◆ editor_manager_

editor::EditorManager yaze::core::Controller::editor_manager_
private

Definition at line 52 of file controller.h.

Referenced by Initialize(), OnEntry(), and OnLoad().

◆ window_

std::shared_ptr<SDL_Window> yaze::core::Controller::window_
private

Definition at line 53 of file controller.h.

Referenced by CreateGuiContext(), CreateRenderer(), CreateWindow(), and window().

◆ backend_

core::PlatformBackend<Sdl2Backend> yaze::core::Controller::backend_
private

Definition at line 54 of file controller.h.

Referenced by CreateGuiContext(), OnEntry(), and OnExit().


The documentation for this class was generated from the following files: