backend-infra-engineer: Pre-0.2.2 2024 Q3 snapshot

This commit is contained in:
scawful
2024-07-31 12:42:04 -04:00
parent 92cc574e15
commit 75bf38fa71
166 changed files with 18107 additions and 9518 deletions

View File

@@ -2,10 +2,11 @@
#define YAZE_APP_CORE_CONTROLLER_H
#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 "imgui/backends/imgui_impl_sdl2.h"
#include "imgui/backends/imgui_impl_sdlrenderer2.h"
#include "imgui/imconfig.h"
#include "imgui/imgui.h"
#include "imgui/imgui_internal.h"
#include <memory>
@@ -22,6 +23,8 @@ namespace yaze {
namespace app {
namespace core {
enum class Platform { kUnknown, kMacOS, kiOS, kWindows, kLinux };
/**
* @brief Main controller for the application.
*
@@ -31,12 +34,20 @@ namespace core {
class Controller : public ExperimentFlags {
public:
bool IsActive() const { return active_; }
absl::Status OnEntry();
absl::Status OnEntry(std::string filename = "");
void OnInput();
void OnLoad();
absl::Status OnLoad();
void DoRender() const;
void OnExit();
absl::Status CreateSDL_Window();
absl::Status CreateRenderer();
absl::Status CreateGuiContext();
absl::Status LoadFontFamilies() const;
absl::Status LoadAudioDevice();
auto master_editor() -> editor::MasterEditor & { return master_editor_; }
private:
struct sdl_deleter {
void operator()(SDL_Window *p) const {
@@ -52,16 +63,17 @@ class Controller : public ExperimentFlags {
void operator()(SDL_Texture *p) const { SDL_DestroyTexture(p); }
};
absl::Status CreateSDL_Window();
absl::Status CreateRenderer();
absl::Status CreateGuiContext();
absl::Status LoadFontFamilies() const;
void CloseWindow() { active_ = false; }
friend int ::main(int argc, char **argv);
bool active_;
Platform platform_;
editor::MasterEditor master_editor_;
int audio_frequency_ = 48000;
int16_t *audio_buffer_;
SDL_AudioDeviceID audio_device_;
std::shared_ptr<SDL_Window> window_;
std::shared_ptr<SDL_Renderer> renderer_;
};
@@ -70,4 +82,4 @@ class Controller : public ExperimentFlags {
} // namespace app
} // namespace yaze
#endif // YAZE_APP_CORE_CONTROLLER_H
#endif // YAZE_APP_CORE_CONTROLLER_H