add on detach

This commit is contained in:
2025-04-17 16:50:12 +03:00
parent de84573915
commit f2960ba125
4 changed files with 14 additions and 0 deletions

View File

@@ -11,6 +11,12 @@ namespace example
hack::log()("on_attach"); hack::log()("on_attach");
} }
void ui_layer::on_detach()
{
VE::DISCONNECT(this);
hack::log()("on_detach");
}
void ui_layer::render() void ui_layer::render()
{ {
ImGui::SetNextWindowPos(m_pos); ImGui::SetNextWindowPos(m_pos);

View File

@@ -11,6 +11,12 @@ namespace example
hack::log()("on_attach"); hack::log()("on_attach");
} }
void ui_layer_double::on_detach()
{
VE::DISCONNECT(this);
hack::log()("on_detach");
}
void ui_layer_double::render() void ui_layer_double::render()
{ {
ImGui::SetNextWindowPos(ImVec2{ 10.f, 10.f }); ImGui::SetNextWindowPos(ImVec2{ 10.f, 10.f });

View File

@@ -16,6 +16,7 @@ namespace VE
public: public:
virtual void on_attach() {}; virtual void on_attach() {};
virtual void on_detach() {};
virtual void render() {}; virtual void render() {};
virtual void update() {}; virtual void update() {};
virtual void on_event(event e) {}; virtual void on_event(event e) {};

View File

@@ -6,6 +6,7 @@
#define VE_OVERIDE()\ #define VE_OVERIDE()\
public:\ public:\
void on_attach() override;\ void on_attach() override;\
void on_detach() override;\
void render() override;\ void render() override;\
void update() override;\ void update() override;\
void on_event(VE::event e) override void on_event(VE::event e) override