diff --git a/bin/layers/local_panel/local_panel.cpp b/bin/layers/local_panel/local_panel.cpp index 3cccfdd..d279e5c 100755 --- a/bin/layers/local_panel/local_panel.cpp +++ b/bin/layers/local_panel/local_panel.cpp @@ -5,7 +5,7 @@ namespace sandbox { void local_panel::on_attach() { - VE_CONNECT(local_panel, on_event); + VE_CONNECT(local_panel); hack::log()("on_attach"); } diff --git a/bin/layers/opengl_panel/opengl_panel.cpp b/bin/layers/opengl_panel/opengl_panel.cpp index ece4fb2..8905d04 100755 --- a/bin/layers/opengl_panel/opengl_panel.cpp +++ b/bin/layers/opengl_panel/opengl_panel.cpp @@ -43,9 +43,11 @@ namespace sandbox void cube::render() { buffer::render(); } + // OPENGL_PANEL_LAYER + void opengl_panel::on_attach() { - VE_CONNECT(opengl_panel, on_event); + VE_CONNECT(opengl_panel); hack::log()("on_attach"); } diff --git a/bin/layers/test_panel/test_panel.cpp b/bin/layers/test_panel/test_panel.cpp index 3f25c57..0bf47e6 100755 --- a/bin/layers/test_panel/test_panel.cpp +++ b/bin/layers/test_panel/test_panel.cpp @@ -5,7 +5,7 @@ namespace sandbox { void test_panel::on_attach() { - VE_CONNECT(test_panel, on_event); + VE_CONNECT(test_panel); hack::log()("on_attach", VE::application::get()->get_glfw()->width()); } diff --git a/bin/layers/test_panel_2/test_panel_2.cpp b/bin/layers/test_panel_2/test_panel_2.cpp index 2db5cbb..03f50bd 100755 --- a/bin/layers/test_panel_2/test_panel_2.cpp +++ b/bin/layers/test_panel_2/test_panel_2.cpp @@ -5,7 +5,7 @@ namespace sandbox { void test_panel_2::on_attach() { - VE_CONNECT(test_panel_2, on_event); + VE_CONNECT(test_panel_2); hack::log()("on_attach"); } diff --git a/src/utils/define.hpp b/src/utils/define.hpp index ab5b358..a010e77 100755 --- a/src/utils/define.hpp +++ b/src/utils/define.hpp @@ -9,7 +9,7 @@ void render() override;\ void on_event(VE::event e) override -#define VE_CONNECT(DEF_CLASS, DEF_FUNCTION) VE::event_manager::instance().connect(std::bind(&DEF_CLASS::DEF_FUNCTION, this, std::placeholders::_1)); +#define VE_CONNECT(DEF_CLASS) VE::event_manager::instance().connect(std::bind(&DEF_CLASS::on_event, this, std::placeholders::_1)); #define VE_EMIT(e) VE::event_manager::instance().emit(e) #define VE_PUSH_FONT(def_font, def_size)\