add test editor load to app Controller
This commit is contained in:
@@ -2,11 +2,6 @@
|
||||
|
||||
#include <SDL.h>
|
||||
|
||||
#include "imgui/backends/imgui_impl_sdl2.h"
|
||||
#include "imgui/backends/imgui_impl_sdlrenderer2.h"
|
||||
#include "imgui/imgui.h"
|
||||
#include "imgui/imgui_internal.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
@@ -16,6 +11,10 @@
|
||||
#include "app/editor/editor_manager.h"
|
||||
#include "app/gui/icons.h"
|
||||
#include "app/gui/style.h"
|
||||
#include "imgui/backends/imgui_impl_sdl2.h"
|
||||
#include "imgui/backends/imgui_impl_sdlrenderer2.h"
|
||||
#include "imgui/imgui.h"
|
||||
#include "imgui/imgui_internal.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
@@ -348,6 +347,11 @@ absl::Status Controller::OnLoad() {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status Controller::OnTestLoad() {
|
||||
RETURN_IF_ERROR(test_editor_->Update());
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
void Controller::DoRender() const {
|
||||
ImGui::Render();
|
||||
SDL_RenderClear(Renderer::GetInstance().renderer());
|
||||
|
||||
@@ -38,6 +38,7 @@ class Controller : public ExperimentFlags {
|
||||
absl::Status OnEntry(std::string filename = "");
|
||||
void OnInput();
|
||||
absl::Status OnLoad();
|
||||
absl::Status OnTestLoad();
|
||||
void DoRender() const;
|
||||
void OnExit();
|
||||
|
||||
@@ -47,18 +48,22 @@ class Controller : public ExperimentFlags {
|
||||
absl::Status LoadFontFamilies() const;
|
||||
absl::Status LoadAudioDevice();
|
||||
|
||||
void SetupScreen(std::string filename = "") { editor_manager_.SetupScreen(filename); }
|
||||
void SetupScreen(std::string filename = "") {
|
||||
editor_manager_.SetupScreen(filename);
|
||||
}
|
||||
auto editor_manager() -> editor::EditorManager & { return editor_manager_; }
|
||||
auto renderer() -> SDL_Renderer * {
|
||||
return Renderer::GetInstance().renderer();
|
||||
}
|
||||
auto window() -> SDL_Window * { return window_.get(); }
|
||||
void init_test_editor(editor::Editor *editor) { test_editor_ = editor; }
|
||||
|
||||
private:
|
||||
friend int ::main(int argc, char **argv);
|
||||
|
||||
bool active_;
|
||||
Platform platform_;
|
||||
editor::Editor *test_editor_;
|
||||
editor::EditorManager editor_manager_;
|
||||
|
||||
int audio_frequency_ = 48000;
|
||||
|
||||
Reference in New Issue
Block a user