Consolidated renderer and window into the controller, added hex text input, removed more junk

This commit is contained in:
scawful
2022-06-14 01:18:17 -04:00
parent c6904fb0c7
commit 389c7c35f0
17 changed files with 216 additions and 260 deletions

View File

@@ -3,14 +3,16 @@
#define SDL_MAIN_HANDLED
#include <SDL2/SDL.h>
#include <imgui/backends/imgui_impl_sdl.h>
#include <imgui/backends/imgui_impl_sdlrenderer.h>
#include <imgui/imgui.h>
#include <imgui/imgui_internal.h>
#include "Core/renderer.h"
#include "Core/window.h"
#include "Editor/editor.h"
#include "Graphics/icons.h"
#include "Graphics/style.h"
int main(int argc, char** argv);
int main(int argc, char **argv);
namespace yaze {
namespace Application {
@@ -28,13 +30,22 @@ class Controller {
void onExit();
private:
void CreateWindow();
void CreateRenderer();
void CreateGuiContext();
inline void quit() { active_ = false; }
friend int ::main(int argc, char** argv);
friend int ::main(int argc, char **argv);
struct sdl_deleter {
void operator()(SDL_Window *p) const { SDL_DestroyWindow(p); }
void operator()(SDL_Renderer *p) const { SDL_DestroyRenderer(p); }
void operator()(SDL_Texture *p) const { SDL_DestroyTexture(p); }
};
bool active_;
Window window_;
Renderer renderer_;
Editor::Editor editor_;
std::shared_ptr<SDL_Window> sdl_window_;
std::shared_ptr<SDL_Renderer> sdl_renderer_;
};
} // namespace Core