fix some struct
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "utils.hpp"
|
#include "utils.hpp"
|
||||||
|
|
||||||
namespace sandbox
|
namespace example
|
||||||
{
|
{
|
||||||
void ui_layer::on_attach()
|
void ui_layer::on_attach()
|
||||||
{
|
{
|
||||||
@@ -13,11 +13,17 @@ namespace sandbox
|
|||||||
|
|
||||||
void ui_layer::render()
|
void ui_layer::render()
|
||||||
{
|
{
|
||||||
// VE::WinPos(m_pos);
|
ImGui::SetNextWindowPos(m_pos);
|
||||||
// VE::WinSize(m_pos);
|
ImGui::SetNextWindowSize(m_size);
|
||||||
|
|
||||||
VE::Begin("name", m_pos, m_size, m_win_flags);
|
if (!ImGui::Begin(VE_NAME("Test signal"), nullptr, m_win_flags)) ImGui::End();
|
||||||
VE::End();
|
|
||||||
|
VE_PUSH_FONT(REGULAR, 20);
|
||||||
|
if (ImGui::Button("Test signal", ImVec2(128, 130)))
|
||||||
|
VE::EMIT(test_event::TEST_EVEN, std::string("test event message"));
|
||||||
|
VE_POP_FONT();
|
||||||
|
|
||||||
|
ImGui::End();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ui_layer::on_event(VE::event e)
|
void ui_layer::on_event(VE::event e)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <VE.hpp>
|
#include <VE.hpp>
|
||||||
|
|
||||||
namespace sandbox
|
namespace example
|
||||||
{
|
{
|
||||||
class ui_layer : public VE::layer, public VE::flags
|
class ui_layer : public VE::layer, public VE::flags
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
namespace sandbox
|
namespace example
|
||||||
{
|
{
|
||||||
enum class test_event
|
enum class test_event
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "layers/ui_layer/ui_layer.hpp"
|
#include "layers/ui_layer/ui_layer.hpp"
|
||||||
|
|
||||||
namespace sandbox
|
namespace example
|
||||||
{
|
{
|
||||||
class app : public VE::application
|
class app : public VE::application
|
||||||
{
|
{
|
||||||
@@ -12,10 +12,10 @@ namespace sandbox
|
|||||||
|
|
||||||
auto main(int argc, char* args[]) -> int
|
auto main(int argc, char* args[]) -> int
|
||||||
{
|
{
|
||||||
sandbox::app app{ "vertex_engine_sandbox" };
|
example::app app{ "vertex_engine_sandbox" };
|
||||||
|
|
||||||
app.push_layer(
|
app.push_layer(
|
||||||
new sandbox::ui_layer{}
|
new example::ui_layer{}
|
||||||
);
|
);
|
||||||
app.run();
|
app.run();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
#include "gui/gui.hpp" // IWYU pragma: keep
|
#include "gui/gui.hpp" // IWYU pragma: keep
|
||||||
#include "gui/flags.hpp" // IWYU pragma: keep
|
#include "gui/flags.hpp" // IWYU pragma: keep
|
||||||
#include "gui/api/win.hpp" // IWYU pragma: keep
|
|
||||||
#include "gui/style/icons.hpp" // IWYU pragma: keep
|
#include "gui/style/icons.hpp" // IWYU pragma: keep
|
||||||
#include "gui/style/fonts.hpp" // IWYU pragma: keep
|
#include "gui/style/fonts.hpp" // IWYU pragma: keep
|
||||||
|
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <imgui.h>
|
|
||||||
|
|
||||||
namespace VE
|
|
||||||
{
|
|
||||||
inline void WinPos(ImVec2 pos)
|
|
||||||
{
|
|
||||||
ImGui::SetNextWindowPos(pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void WinSize(ImVec2 size)
|
|
||||||
{
|
|
||||||
ImGui::SetNextWindowSize(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void End()
|
|
||||||
{
|
|
||||||
ImGui::End();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void Begin(std::string name, ImVec2 pos, ImVec2 size, bool& open, ImGuiWindowFlags win_flags)
|
|
||||||
{
|
|
||||||
WinPos(pos);
|
|
||||||
WinSize(size);
|
|
||||||
|
|
||||||
if (!ImGui::Begin(name.c_str(), &open, win_flags)) End();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void Begin(std::string name, ImVec2 pos, ImVec2 size, ImGuiWindowFlags win_flags)
|
|
||||||
{
|
|
||||||
WinPos(pos);
|
|
||||||
WinSize(size);
|
|
||||||
|
|
||||||
if (!ImGui::Begin(name.c_str(), nullptr, win_flags)) End();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void Begin(std::string name, ImGuiWindowFlags win_flags)
|
|
||||||
{
|
|
||||||
if (!ImGui::Begin(name.c_str(), nullptr, win_flags)) End();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user