yaze 0.2.0
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
controller.h
Go to the documentation of this file.
1#ifndef YAZE_APP_CORE_CONTROLLER_H
2#define YAZE_APP_CORE_CONTROLLER_H
3
4#include <SDL.h>
5
6#include <memory>
7
8#include "absl/status/status.h"
12#include "app/editor/editor.h"
13#include "imgui/backends/imgui_impl_sdl2.h"
14#include "imgui/backends/imgui_impl_sdlrenderer2.h"
15#include "imgui/imconfig.h"
16#include "imgui/imgui.h"
17
18int main(int argc, char **argv);
19
20namespace yaze {
21namespace app {
22namespace core {
23
31 public:
32 bool IsActive() const { return active_; }
33 absl::Status OnEntry(std::string filename = "");
34 void OnInput();
35 absl::Status OnLoad();
36 absl::Status OnTestLoad();
37 void DoRender() const;
38 void OnExit();
39
40 absl::Status CreateWindow();
41 absl::Status CreateRenderer();
42 absl::Status CreateGuiContext();
43 absl::Status LoadFontFamilies() const;
44 absl::Status LoadAudioDevice();
45 absl::Status LoadConfigFiles();
46
47 void SetupScreen(std::string filename = "") {
49 }
51 auto renderer() -> SDL_Renderer * {
53 }
54 auto window() -> SDL_Window * { return window_.get(); }
55 void init_test_editor(editor::Editor *editor) { test_editor_ = editor; }
56 void set_active(bool active) { active_ = active; }
57
58 private:
59 friend int ::main(int argc, char **argv);
60
61 bool active_;
65
66 int audio_frequency_ = 48000;
67 SDL_AudioDeviceID audio_device_;
68 std::shared_ptr<int16_t> audio_buffer_;
69 std::shared_ptr<SDL_Window> window_;
70};
71
72} // namespace core
73} // namespace app
74} // namespace yaze
75
76#endif // YAZE_APP_CORE_CONTROLLER_H
Main controller for the application.
Definition controller.h:30
SDL_AudioDeviceID audio_device_
Definition controller.h:67
void SetupScreen(std::string filename="")
Definition controller.h:47
absl::Status CreateGuiContext()
editor::EditorManager editor_manager_
Definition controller.h:64
absl::Status LoadFontFamilies() const
absl::Status LoadAudioDevice()
std::shared_ptr< SDL_Window > window_
Definition controller.h:69
void set_active(bool active)
Definition controller.h:56
auto window() -> SDL_Window *
Definition controller.h:54
absl::Status OnEntry(std::string filename="")
Definition controller.cc:53
absl::Status LoadConfigFiles()
editor::Editor * test_editor_
Definition controller.h:63
auto renderer() -> SDL_Renderer *
Definition controller.h:51
absl::Status CreateRenderer()
auto editor_manager() -> editor::EditorManager &
Definition controller.h:50
void init_test_editor(editor::Editor *editor)
Definition controller.h:55
std::shared_ptr< int16_t > audio_buffer_
Definition controller.h:68
A class to manage experimental feature flags.
Definition common.h:36
auto renderer() -> SDL_Renderer *
Definition renderer.h:44
static Renderer & GetInstance()
Definition renderer.h:27
The EditorManager controls the main editor window and manages the various editor classes.
void SetupScreen(std::string filename="")
Interface for editor classes.
Definition editor.h:54
int main(int argc, char **argv)
Main entry point for the application.
Definition emu.cc:33
Definition common.cc:22