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 () |
absl::Status | OnTestLoad () |
void | DoRender () const |
void | OnExit () |
absl::Status | CreateSDL_Window () |
absl::Status | CreateRenderer () |
absl::Status | CreateGuiContext () |
absl::Status | LoadFontFamilies () const |
absl::Status | LoadAudioDevice () |
void | SetupScreen (std::string filename="") |
auto | editor_manager () -> editor::EditorManager & |
auto | renderer () -> SDL_Renderer * |
auto | window () -> SDL_Window * |
void | init_test_editor (editor::Editor *editor) |
void | set_active (bool active) |
Public Member Functions inherited from yaze::app::core::ExperimentFlags | |
ExperimentFlags ()=default | |
virtual | ~ExperimentFlags ()=default |
auto | flags () const |
Flags * | mutable_flags () |
std::string | Serialize () const |
Private Member Functions | |
friend | int::main (int argc, char **argv) |
Private Attributes | |
bool | active_ |
Platform | platform_ |
editor::Editor * | test_editor_ |
editor::EditorManager | editor_manager_ |
int | audio_frequency_ = 48000 |
SDL_AudioDeviceID | audio_device_ |
std::shared_ptr< int16_t > | audio_buffer_ |
std::shared_ptr< SDL_Window > | window_ |
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 34 of file controller.h.
|
inline |
Definition at line 36 of file controller.h.
References active_.
Referenced by main(), and yaze::test::integration::RunIntegrationTest().
absl::Status yaze::app::core::Controller::OnEntry | ( | std::string | filename = "" | ) |
Definition at line 250 of file controller.cc.
References active_, CreateGuiContext(), CreateRenderer(), CreateSDL_Window(), editor_manager_, yaze::app::core::kiOS, yaze::app::core::kLinux, yaze::app::core::kMacOS, yaze::app::core::kUnknown, yaze::app::core::kWindows, LoadAudioDevice(), platform_, RETURN_IF_ERROR, and yaze::app::editor::EditorManager::SetupScreen().
Referenced by main().
void yaze::app::core::Controller::OnInput | ( | ) |
Definition at line 275 of file controller.cc.
References active_, and editor_manager_.
Referenced by main(), and yaze::test::integration::RunIntegrationTest().
absl::Status yaze::app::core::Controller::OnLoad | ( | ) |
Definition at line 314 of file controller.cc.
References active_, editor_manager_, yaze::app::core::kiOS, platform_, yaze::app::editor::EditorManager::quit(), RETURN_IF_ERROR, and yaze::app::editor::EditorManager::Update().
Referenced by main().
absl::Status yaze::app::core::Controller::OnTestLoad | ( | ) |
Definition at line 332 of file controller.cc.
References RETURN_IF_ERROR, test_editor_, and yaze::app::editor::Editor::Update().
Referenced by yaze::test::integration::RunIntegrationTest().
void yaze::app::core::Controller::DoRender | ( | ) | const |
Definition at line 337 of file controller.cc.
References yaze::app::core::Renderer::GetInstance(), and renderer().
Referenced by main(), and yaze::test::integration::RunIntegrationTest().
void yaze::app::core::Controller::OnExit | ( | ) |
Definition at line 345 of file controller.cc.
References audio_device_.
Referenced by main(), and yaze::test::integration::RunIntegrationTest().
absl::Status yaze::app::core::Controller::CreateSDL_Window | ( | ) |
Definition at line 354 of file controller.cc.
References yaze::app::core::ExperimentFlags::flags(), and window_.
Referenced by OnEntry(), and yaze::test::integration::RunIntegrationTest().
absl::Status yaze::app::core::Controller::CreateRenderer | ( | ) |
Definition at line 385 of file controller.cc.
References yaze::app::core::Renderer::CreateRenderer(), yaze::app::core::Renderer::GetInstance(), and window_.
Referenced by OnEntry(), and yaze::test::integration::RunIntegrationTest().
absl::Status yaze::app::core::Controller::CreateGuiContext | ( | ) |
Definition at line 389 of file controller.cc.
References yaze::app::gui::ColorsYaze(), yaze::app::core::ExperimentFlags::flags(), yaze::app::core::Renderer::GetInstance(), LoadFontFamilies(), LoadSystemFonts(), renderer(), yaze::app::core::Renderer::renderer(), RETURN_IF_ERROR, and window_.
Referenced by OnEntry().
absl::Status yaze::app::core::Controller::LoadFontFamilies | ( | ) | const |
Definition at line 421 of file controller.cc.
References FONT_ICON_FILE_NAME_MD, yaze::app::core::GetBundleResourcePath(), and ICON_MIN_MD.
Referenced by CreateGuiContext().
absl::Status yaze::app::core::Controller::LoadAudioDevice | ( | ) |
Definition at line 518 of file controller.cc.
References audio_buffer_, audio_device_, audio_frequency_, editor_manager_, and yaze::app::editor::EditorManager::emulator().
Referenced by OnEntry().
|
inline |
Definition at line 50 of file controller.h.
References editor_manager_, and yaze::app::editor::EditorManager::SetupScreen().
|
inline |
Definition at line 53 of file controller.h.
References editor_manager_.
|
inline |
Definition at line 54 of file controller.h.
References yaze::app::core::Renderer::GetInstance(), and yaze::app::core::Renderer::renderer().
Referenced by CreateGuiContext(), and DoRender().
|
inline |
Definition at line 57 of file controller.h.
References window_.
Referenced by yaze::test::integration::RunIntegrationTest().
|
inline |
Definition at line 58 of file controller.h.
References test_editor_.
Referenced by yaze::test::integration::RunIntegrationTest().
|
inline |
Definition at line 59 of file controller.h.
References active_.
Referenced by yaze::test::integration::RunIntegrationTest().
|
private |
|
private |
Definition at line 64 of file controller.h.
Referenced by IsActive(), OnEntry(), OnInput(), OnLoad(), and set_active().
|
private |
Definition at line 65 of file controller.h.
|
private |
Definition at line 66 of file controller.h.
Referenced by init_test_editor(), and OnTestLoad().
|
private |
Definition at line 67 of file controller.h.
Referenced by editor_manager(), LoadAudioDevice(), OnEntry(), OnInput(), OnLoad(), and SetupScreen().
|
private |
Definition at line 69 of file controller.h.
Referenced by LoadAudioDevice().
|
private |
Definition at line 70 of file controller.h.
Referenced by LoadAudioDevice(), and OnExit().
|
private |
Definition at line 71 of file controller.h.
Referenced by LoadAudioDevice().
|
private |
Definition at line 72 of file controller.h.
Referenced by CreateGuiContext(), CreateRenderer(), CreateSDL_Window(), and window().