add new struct and events

This commit is contained in:
2025-04-08 15:16:20 +03:00
parent ff3122c74d
commit 1ab87dd53d
35 changed files with 264 additions and 624 deletions

View File

@@ -0,0 +1,46 @@
#include "ui_layer.hpp"
#include "utils.hpp"
namespace sandbox
{
void ui_layer::on_attach()
{
VE::CONNECT(this);
hack::log()("on_attach");
}
void ui_layer::render()
{
// VE::WinPos(m_pos);
// VE::WinSize(m_pos);
VE::Begin("name", m_pos, m_size, m_win_flags);
VE::End();
}
void ui_layer::on_event(VE::event e)
{
// для событий от перефирии
// if (e.m_type.type() == typeid(VE::event_type))
// {
// auto t = std::any_cast<VE::event_type>(e.m_type);
// if (t != VE::event_type::MOUSE_CURSOR_POSITION)
// hack::log()((int)t);
// }
if (e.m_type.type() == typeid(test_event))
{
auto t = std::any_cast<test_event>(e.m_type);
if (t == test_event::TEST_EVEN)
hack::log()(std::any_cast<std::string>(e.m_data));
}
}
void ui_layer::update()
{
}
}