From 44ca1ffb3e5dd7fd2e6d2f2b2f4fe5b29f5d73a7 Mon Sep 17 00:00:00 2001 From: chatlanin Date: Wed, 22 Jan 2025 15:38:40 +0300 Subject: [PATCH] remove render permit --- bin/layers/opengl_panel/opengl_panel.hpp | 2 +- bin/layers/test_panel/test_panel.hpp | 2 +- bin/layers/test_panel_2/test_panel_2.hpp | 2 +- src/application/application.cpp | 2 +- src/layer/layer.hpp | 7 +------ src/utils/define.hpp | 4 +--- 6 files changed, 6 insertions(+), 13 deletions(-) diff --git a/bin/layers/opengl_panel/opengl_panel.hpp b/bin/layers/opengl_panel/opengl_panel.hpp index 54cb6c4..b84826f 100755 --- a/bin/layers/opengl_panel/opengl_panel.hpp +++ b/bin/layers/opengl_panel/opengl_panel.hpp @@ -85,7 +85,7 @@ namespace sandbox class opengl_panel : public VE::layer { - VE_FN_OVERIDE(opengl_panel, true); + VE_FN_OVERIDE(); cube m_cb_1; cube m_cb_2; diff --git a/bin/layers/test_panel/test_panel.hpp b/bin/layers/test_panel/test_panel.hpp index 4ae2f4f..6226352 100755 --- a/bin/layers/test_panel/test_panel.hpp +++ b/bin/layers/test_panel/test_panel.hpp @@ -6,7 +6,7 @@ namespace sandbox { class test_panel : public VE::layer { - VE_FN_OVERIDE(test_panel, false); + VE_FN_OVERIDE(); ImVec2 m_size = ImVec2{ 600.f, 100.f }; ImVec2 m_pos = ImVec2{ 100.f, 100.f }; diff --git a/bin/layers/test_panel_2/test_panel_2.hpp b/bin/layers/test_panel_2/test_panel_2.hpp index 8e7f607..aa8e5ec 100755 --- a/bin/layers/test_panel_2/test_panel_2.hpp +++ b/bin/layers/test_panel_2/test_panel_2.hpp @@ -6,7 +6,7 @@ namespace sandbox { class test_panel_2 : public VE::layer { - VE_FN_OVERIDE(test_panel_2, true); + VE_FN_OVERIDE(); ImVec2 m_size = ImVec2{ 400.f, 400.f }; ImVec2 m_pos = ImVec2{ 400.f, 400.f }; diff --git a/src/application/application.cpp b/src/application/application.cpp index f0430c5..2831cf4 100755 --- a/src/application/application.cpp +++ b/src/application/application.cpp @@ -21,7 +21,7 @@ namespace VE m_glfw->clear(); m_gui->begin_frame(); - for (auto l : m_layers_stack) if (l->m_render_permit) l->render(); + for (auto l : m_layers_stack) l->render(); m_gui->end_frame(); m_glfw->update(); diff --git a/src/layer/layer.hpp b/src/layer/layer.hpp index 13c53f1..6b166e1 100755 --- a/src/layer/layer.hpp +++ b/src/layer/layer.hpp @@ -10,7 +10,7 @@ namespace VE using time = time::timestep; public: - layer(bool p) : m_render_permit { p } {} + layer() = default; virtual ~layer() = default; layer(const layer&) = delete; @@ -24,11 +24,6 @@ namespace VE void set_event_fn(const event_fn& fn) { execute = fn; }; - public: - // Внекоторых случаях необходимо чтобы компонент был в системе сигналов, но не - // в системе отрисовки. Например при вкладках. - bool m_render_permit; - protected: event_fn execute; }; diff --git a/src/utils/define.hpp b/src/utils/define.hpp index 0def5c0..d56e099 100755 --- a/src/utils/define.hpp +++ b/src/utils/define.hpp @@ -6,9 +6,7 @@ #define VE_EVENT_FN\ std::bind(&application::on_event, this, std::placeholders::_1) -#define VE_FN_OVERIDE(def_class_name, def_render_permit)\ - public:\ - def_class_name() : VE::layer { def_render_permit } {}\ +#define VE_FN_OVERIDE()\ public:\ void on_attach() override;\ void on_detach() override;\