hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/src/core/application.h
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-23 21:55:36 +0200
committerhachem <im@hachem.wtf>2026-08-23 21:55:36 +0200
commit6ee03a2ea3c764f0364b2e61beb6812226facd4c (patch)
treeb5ada601ae22229d207fda3b91e7aed84b336e8b /src/core/application.h
parent2959cfaf69d770955ab655379134e037590a6933 (diff)
feat: implement ui layer arch
Diffstat (limited to 'src/core/application.h')
-rw-r--r--src/core/application.h41
1 files changed, 12 insertions, 29 deletions
diff --git a/src/core/application.h b/src/core/application.h
index 84cc600..880a495 100644
--- a/src/core/application.h
+++ b/src/core/application.h
@@ -4,14 +4,14 @@
#include "window.h"
#include "event.h"
#include "log.h"
-#include "camera.h"
#include "rendering/rhi.h"
-#include "rendering/scene_renderer.h"
-#include "rendering/black_hole_renderer.h"
+#include "rendering/render_path.h"
+#include "rendering/view.h"
+#include "scene/scene.h"
+#include "ui/ui_layer.h"
#include <string>
-#include <vector>
namespace Donut
{
@@ -33,32 +33,15 @@ namespace Donut
auto on_shutdown() -> void;
auto on_event(Event& event) -> void;
- auto build_ui() -> void;
- auto build_scene_ui() -> void;
-
- auto process_input() -> void;
- auto set_free_fly(bool enabled) -> void;
- auto reset_camera() -> void;
- auto set_hdri(const std::string& path) -> void;
-
auto render_frame() -> void;
+ auto update_input(View view) -> void;
private:
- Scope<Window> m_window;
-
- Scope<RHI::Device> m_device;
- Scope<SceneRenderer> m_scene_renderer;
- Scope<BlackHoleRenderer> m_black_hole_renderer;
- Ref<RHI::Texture> m_cubemap;
-
- Camera m_camera{ 60.0f, 16.0f / 9.0f, 0.1f, 100.0f };
- Camera m_scene_camera{ 45.0f, 16.0f / 9.0f, 0.1f, 1000.0f };
-
- BlackHoleParams m_bh_params;
- std::vector<SceneObject> m_scene_objects{ SceneObject{} };
- int m_selected_object = 0;
- bool m_scene_mode = false;
- std::string m_hdri_path;
+ Scope<Window> m_window;
+ Scope<RHI::Device> m_device;
+ Scope<Scene> m_scene;
+ Scope<RenderPath> m_render_path;
+ Scope<UILayer> m_ui;
bool m_left_was_down = false;
double m_fps_last_x = 0.0, m_fps_last_y = 0.0;
@@ -66,8 +49,8 @@ namespace Donut
double m_start_time = 0.0;
bool m_user_moving = false;
- bool m_running;
- bool m_minimized;
+ bool m_running = true;
+ bool m_minimized = false;
static Application* s_instance;
};