backend-infra-engineer: Pre-0.2.2 snapshot (2023)
This commit is contained in:
@@ -2,17 +2,19 @@
|
||||
#define YAZE_APP_CORE_CONTROLLER_H
|
||||
|
||||
#include <SDL.h>
|
||||
#include <imgui/backends/imgui_impl_sdl.h>
|
||||
#include <imgui/backends/imgui_impl_sdlrenderer.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"
|
||||
#include "app/core/common.h"
|
||||
#include "app/core/editor.h"
|
||||
#include "app/editor/master_editor.h"
|
||||
#include "gui/icons.h"
|
||||
#include "gui/style.h"
|
||||
#include "app/gui/icons.h"
|
||||
#include "app/gui/style.h"
|
||||
|
||||
int main(int argc, char **argv);
|
||||
|
||||
@@ -20,26 +22,34 @@ namespace yaze {
|
||||
namespace app {
|
||||
namespace core {
|
||||
|
||||
class Controller {
|
||||
class Controller : public ExperimentFlags {
|
||||
public:
|
||||
bool isActive() const;
|
||||
absl::Status onEntry();
|
||||
void onInput();
|
||||
void onLoad();
|
||||
void onLoadDelta();
|
||||
void doRender() const;
|
||||
void onExit() const;
|
||||
bool IsActive() const { return active_; }
|
||||
absl::Status OnEntry();
|
||||
void OnInput();
|
||||
void OnLoad();
|
||||
void DoRender() const;
|
||||
void OnExit();
|
||||
|
||||
private:
|
||||
struct sdl_deleter {
|
||||
void operator()(SDL_Window *p) const { SDL_DestroyWindow(p); }
|
||||
void operator()(SDL_Renderer *p) const { SDL_DestroyRenderer(p); }
|
||||
void operator()(SDL_Window *p) const {
|
||||
if (p) {
|
||||
SDL_DestroyWindow(p);
|
||||
}
|
||||
}
|
||||
void operator()(SDL_Renderer *p) const {
|
||||
if (p) {
|
||||
SDL_DestroyRenderer(p);
|
||||
}
|
||||
}
|
||||
void operator()(SDL_Texture *p) const { SDL_DestroyTexture(p); }
|
||||
};
|
||||
|
||||
absl::Status CreateWindow();
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user