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 | CreateWindow () |
absl::Status | CreateRenderer () |
absl::Status | CreateGuiContext () |
absl::Status | LoadFontFamilies () const |
absl::Status | LoadAudioDevice () |
absl::Status | LoadConfigFiles () |
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) |
auto | active () const |
Private Member Functions | |
friend | int::main (int argc, char **argv) |
Private Attributes | |
bool | active_ = false |
Platform | platform_ = Platform::kUnknown |
editor::Editor * | test_editor_ = nullptr |
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 29 of file controller.h.
|
inline |
Definition at line 31 of file controller.h.
References active_.
Referenced by yaze::test::integration::RunIntegrationTest().
absl::Status yaze::core::Controller::OnEntry | ( | std::string | filename = "" | ) |
Definition at line 21 of file controller.cc.
References active_, CreateGuiContext(), CreateRenderer(), CreateWindow(), editor_manager_, yaze::core::kiOS, yaze::core::kLinux, yaze::core::kMacOS, yaze::core::kUnknown, yaze::core::kWindows, LoadAudioDevice(), platform_, and RETURN_IF_ERROR.
void yaze::core::Controller::OnInput | ( | ) |
Definition at line 44 of file controller.cc.
References active_.
Referenced by yaze::test::integration::RunIntegrationTest().
absl::Status yaze::core::Controller::OnLoad | ( | ) |
Definition at line 91 of file controller.cc.
References active_, editor_manager_, yaze::gui::kZeroPos, and RETURN_IF_ERROR.
absl::Status yaze::core::Controller::OnTestLoad | ( | ) |
Definition at line 120 of file controller.cc.
References RETURN_IF_ERROR, and test_editor_.
Referenced by yaze::test::integration::RunIntegrationTest().
void yaze::core::Controller::DoRender | ( | ) | const |
Definition at line 125 of file controller.cc.
References yaze::core::Renderer::GetInstance(), and renderer().
Referenced by yaze::test::integration::RunIntegrationTest().
void yaze::core::Controller::OnExit | ( | ) |
Definition at line 133 of file controller.cc.
References audio_device_.
Referenced by yaze::test::integration::RunIntegrationTest().
absl::Status yaze::core::Controller::CreateWindow | ( | ) |
Definition at line 142 of file controller.cc.
References window_.
Referenced by OnEntry(), and yaze::test::integration::RunIntegrationTest().
absl::Status yaze::core::Controller::CreateRenderer | ( | ) |
Definition at line 171 of file controller.cc.
References yaze::core::Renderer::CreateRenderer(), yaze::core::Renderer::GetInstance(), and window_.
Referenced by OnEntry(), and yaze::test::integration::RunIntegrationTest().
absl::Status yaze::core::Controller::CreateGuiContext | ( | ) |
Definition at line 175 of file controller.cc.
References yaze::gui::ColorsYaze(), yaze::core::Renderer::GetInstance(), LoadFontFamilies(), renderer(), RETURN_IF_ERROR, and window_.
Referenced by OnEntry().
absl::Status yaze::core::Controller::LoadFontFamilies | ( | ) | const |
Definition at line 199 of file controller.cc.
References yaze::core::LoadPackageFonts().
Referenced by CreateGuiContext().
absl::Status yaze::core::Controller::LoadAudioDevice | ( | ) |
Definition at line 204 of file controller.cc.
References audio_buffer_, audio_device_, audio_frequency_, and editor_manager_.
Referenced by OnEntry().
absl::Status yaze::core::Controller::LoadConfigFiles | ( | ) |
Definition at line 225 of file controller.cc.
References yaze::core::GetConfigDirectory(), and platform_.
|
inline |
Definition at line 46 of file controller.h.
References editor_manager_.
|
inline |
Definition at line 49 of file controller.h.
References editor_manager_.
|
inline |
Definition at line 50 of file controller.h.
References yaze::core::Renderer::GetInstance(), and yaze::core::Renderer::renderer().
Referenced by CreateGuiContext(), and DoRender().
|
inline |
Definition at line 53 of file controller.h.
References window_.
Referenced by yaze::test::integration::RunIntegrationTest().
|
inline |
Definition at line 54 of file controller.h.
References test_editor_.
Referenced by yaze::test::integration::RunIntegrationTest().
|
inline |
Definition at line 55 of file controller.h.
References active(), and active_.
Referenced by yaze::test::integration::RunIntegrationTest().
|
inline |
|
private |
|
private |
Definition at line 61 of file controller.h.
Referenced by active(), IsActive(), OnEntry(), OnInput(), OnLoad(), and set_active().
|
private |
Definition at line 62 of file controller.h.
Referenced by LoadConfigFiles(), and OnEntry().
|
private |
Definition at line 63 of file controller.h.
Referenced by init_test_editor(), and OnTestLoad().
|
private |
Definition at line 64 of file controller.h.
Referenced by editor_manager(), LoadAudioDevice(), OnEntry(), OnLoad(), and SetupScreen().
|
private |
Definition at line 66 of file controller.h.
Referenced by LoadAudioDevice().
|
private |
Definition at line 67 of file controller.h.
Referenced by LoadAudioDevice(), and OnExit().
|
private |
Definition at line 68 of file controller.h.
Referenced by LoadAudioDevice().
|
private |
Definition at line 69 of file controller.h.
Referenced by CreateGuiContext(), CreateRenderer(), CreateWindow(), and window().