add shared test

This commit is contained in:
2025-03-06 08:31:22 +03:00
parent 42e9d6c45c
commit a3a6a3a07f
4 changed files with 25 additions and 4 deletions

View File

@@ -6,6 +6,14 @@ namespace sandbox
{
class local_panel : public VE::layer
{
public:
local_panel() = default;
local_panel(const local_panel& lp)
{
m_size = lp.m_size;
m_pos = lp.m_pos;
}
VE_FN_OVERIDE();
ImVec2 m_size = ImVec2{ 800.f, 400.f };

View File

@@ -9,6 +9,14 @@ namespace sandbox
// ATTENTION: активировать сигнальную систему в детях-компонентах
m_local_panel.on_attach();
for (int i = 0; i < 200; ++i)
{
auto lp = std::make_shared<local_panel>();
lp->on_attach();
m_local_panel_hub.push_back(lp);
}
hack::log()("on_attach");
}
@@ -21,6 +29,8 @@ namespace sandbox
m_local_panel.render();
for(auto& lp : m_local_panel_hub) lp->render();
ImGui::End();
}

View File

@@ -14,6 +14,8 @@ namespace sandbox
ImVec2 m_pos = ImVec2{ 400.f, 400.f };
local_panel m_local_panel;
std::vector<std::shared_ptr<local_panel>> m_local_panel_hub;
};
}