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 "imgui/backends/imgui_impl_sdl2.h"
9#include "imgui/backends/imgui_impl_sdlrenderer2.h"
10#include "imgui/imconfig.h"
11#include "imgui/imgui.h"
12#include "imgui/imgui_internal.h"
13#include "absl/status/status.h"
17#include "app/gui/icons.h"
18#include "app/gui/style.h"
19
20int main(int argc, char **argv);
21
22namespace yaze {
23namespace app {
24namespace core {
25
27
35 public:
36 bool IsActive() const { return active_; }
37 absl::Status OnEntry(std::string filename = "");
38 void OnInput();
39 absl::Status OnLoad();
40 absl::Status OnTestLoad();
41 void DoRender() const;
42 void OnExit();
43
44 absl::Status CreateSDL_Window();
45 absl::Status CreateRenderer();
46 absl::Status CreateGuiContext();
47 absl::Status LoadFontFamilies() const;
48 absl::Status LoadAudioDevice();
49
50 void SetupScreen(std::string filename = "") {
52 }
54 auto renderer() -> SDL_Renderer * {
56 }
57 auto window() -> SDL_Window * { return window_.get(); }
58 void init_test_editor(editor::Editor *editor) { test_editor_ = editor; }
59 void set_active(bool active) { active_ = active; }
60
61 private:
62 friend int ::main(int argc, char **argv);
63
64 bool active_;
68
69 int audio_frequency_ = 48000;
70 SDL_AudioDeviceID audio_device_;
71 std::shared_ptr<int16_t> audio_buffer_;
72 std::shared_ptr<SDL_Window> window_;
73};
74
75} // namespace core
76} // namespace app
77} // namespace yaze
78
79#endif // YAZE_APP_CORE_CONTROLLER_H
Main controller for the application.
Definition controller.h:34
SDL_AudioDeviceID audio_device_
Definition controller.h:70
void SetupScreen(std::string filename="")
Definition controller.h:50
absl::Status CreateGuiContext()
editor::EditorManager editor_manager_
Definition controller.h:67
absl::Status LoadFontFamilies() const
absl::Status LoadAudioDevice()
absl::Status CreateSDL_Window()
std::shared_ptr< SDL_Window > window_
Definition controller.h:72
void set_active(bool active)
Definition controller.h:59
auto window() -> SDL_Window *
Definition controller.h:57
absl::Status OnEntry(std::string filename="")
editor::Editor * test_editor_
Definition controller.h:66
auto renderer() -> SDL_Renderer *
Definition controller.h:54
absl::Status CreateRenderer()
auto editor_manager() -> editor::EditorManager &
Definition controller.h:53
void init_test_editor(editor::Editor *editor)
Definition controller.h:58
std::shared_ptr< int16_t > audio_buffer_
Definition controller.h:71
A class to manage experimental feature flags.
Definition common.h:30
auto renderer() -> SDL_Renderer *
Definition renderer.h:47
static Renderer & GetInstance()
Definition renderer.h:30
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:39
int main(int argc, char **argv)
Main entry point for the application.
Definition emu.cc:33
Definition common.cc:21