fix def emit
This commit is contained in:
@@ -15,7 +15,7 @@ namespace sandbox
|
|||||||
if (ImGui::Button("RUN 2", ImVec2(28, 30)))
|
if (ImGui::Button("RUN 2", ImVec2(28, 30)))
|
||||||
{
|
{
|
||||||
VE::event e { "target_id", test_event::TEST_EVEN , std::string("test event message") };
|
VE::event e { "target_id", test_event::TEST_EVEN , std::string("test event message") };
|
||||||
EMIT(e);
|
VE_EMIT(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
VE_PUSH_FONT(ICON, 18);
|
VE_PUSH_FONT(ICON, 18);
|
||||||
@@ -23,7 +23,7 @@ namespace sandbox
|
|||||||
if (ImGui::Button(VE::style::icon::ICON_STOP, ImVec2(28, 30)))
|
if (ImGui::Button(VE::style::icon::ICON_STOP, ImVec2(28, 30)))
|
||||||
{
|
{
|
||||||
VE::event e { "target_id", test_event::TEST_EVEN , std::string("test icon button") };
|
VE::event e { "target_id", test_event::TEST_EVEN , std::string("test icon button") };
|
||||||
EMIT(e);
|
VE_EMIT(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::Text(VE::style::icon::ICON_PAINT_BRUSH, " Paint" );
|
ImGui::Text(VE::style::icon::ICON_PAINT_BRUSH, " Paint" );
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace sandbox
|
|||||||
if (ImGui::Button("RUN", ImVec2(28, 30)))
|
if (ImGui::Button("RUN", ImVec2(28, 30)))
|
||||||
{
|
{
|
||||||
VE::event e { "target_id", test_event::TEST_EVEN , std::string("test event message") };
|
VE::event e { "target_id", test_event::TEST_EVEN , std::string("test event message") };
|
||||||
EMIT(e);
|
VE_EMIT(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ namespace VE
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EMIT(e);
|
VE_EMIT(e);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,7 +173,7 @@ namespace VE
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EMIT(e);
|
VE_EMIT(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
glfwSetScrollCallback(m_win, [](GLFWwindow* w, double xOffset, double yOffset)
|
glfwSetScrollCallback(m_win, [](GLFWwindow* w, double xOffset, double yOffset)
|
||||||
@@ -181,7 +181,7 @@ namespace VE
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
event e{ event_target::VE, event_type::MOUSE_SCROLL, std::pair<float, float>{ static_cast<float>(xOffset), static_cast<float>(yOffset) } };
|
event e{ event_target::VE, event_type::MOUSE_SCROLL, std::pair<float, float>{ static_cast<float>(xOffset), static_cast<float>(yOffset) } };
|
||||||
EMIT(e);
|
VE_EMIT(e);
|
||||||
}
|
}
|
||||||
catch(std::exception& e)
|
catch(std::exception& e)
|
||||||
{
|
{
|
||||||
@@ -194,7 +194,7 @@ namespace VE
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
event e{ event_target::VE, event_type::MOUSE_CURSOR_POSITION, std::pair<float, float>{ static_cast<float>(xPos), static_cast<float>(yPos) } };
|
event e{ event_target::VE, event_type::MOUSE_CURSOR_POSITION, std::pair<float, float>{ static_cast<float>(xPos), static_cast<float>(yPos) } };
|
||||||
EMIT(e);
|
VE_EMIT(e);
|
||||||
}
|
}
|
||||||
catch(std::exception& e)
|
catch(std::exception& e)
|
||||||
{
|
{
|
||||||
@@ -216,7 +216,7 @@ namespace VE
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
event e{ event_target::VE, event_type::WINDOW_RESIZE, std::pair<float, float>{ static_cast<float>(width), static_cast<float>(height) } };
|
event e{ event_target::VE, event_type::WINDOW_RESIZE, std::pair<float, float>{ static_cast<float>(width), static_cast<float>(height) } };
|
||||||
EMIT(e);
|
VE_EMIT(e);
|
||||||
}
|
}
|
||||||
catch(std::exception& e)
|
catch(std::exception& e)
|
||||||
{
|
{
|
||||||
@@ -229,7 +229,7 @@ namespace VE
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
event e{ event_target::VE, event_type::WINDOW_CLOSE, nullptr };
|
event e{ event_target::VE, event_type::WINDOW_CLOSE, nullptr };
|
||||||
EMIT(e);
|
VE_EMIT(e);
|
||||||
}
|
}
|
||||||
catch(std::exception& e)
|
catch(std::exception& e)
|
||||||
{
|
{
|
||||||
@@ -242,7 +242,7 @@ namespace VE
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
event e{ event_target::VE, event_type::WINDOW_FOCUS, focused };
|
event e{ event_target::VE, event_type::WINDOW_FOCUS, focused };
|
||||||
EMIT(e);
|
VE_EMIT(e);
|
||||||
}
|
}
|
||||||
catch(std::exception& e)
|
catch(std::exception& e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
void on_event(VE::event e) 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, DEF_FUNCTION) VE::event_manager::instance().connect(std::bind(&DEF_CLASS::DEF_FUNCTION, this, std::placeholders::_1));
|
||||||
#define EMIT(e) VE::event_manager::instance().emit(e)
|
#define VE_EMIT(e) VE::event_manager::instance().emit(e)
|
||||||
|
|
||||||
#define VE_PUSH_FONT(def_font, def_size)\
|
#define VE_PUSH_FONT(def_font, def_size)\
|
||||||
ImGui::PushFont(VE::style::fonts::get_font(VE::style::fonts::font_type::def_font, def_size))
|
ImGui::PushFont(VE::style::fonts::get_font(VE::style::fonts::font_type::def_font, def_size))
|
||||||
|
|||||||
Reference in New Issue
Block a user