light/modules/engine/include/engine/user_interface/user_interface.hpp

55 lines
984 B
C++
Raw Normal View History

2022-03-08 21:19:19 +03:30
#pragma once
2025-07-05 13:28:41 +03:30
#include <engine/base/base.hpp>
2022-03-08 21:19:19 +03:30
#include <imgui.h>
struct GLFWwindow;
namespace Light {
class Event;
class SharedContext;
// #todo: fix the UserIntreface mess!!
class UserInterface /* singleton */
{
public:
static Scope<UserInterface> create(GLFWwindow *windowHandle, Ref<SharedContext> sharedContext);
2022-03-08 21:19:19 +03:30
2025-07-05 13:28:41 +03:30
UserInterface(const UserInterface &) = delete;
2025-07-05 16:07:51 +03:30
2025-07-05 13:28:41 +03:30
UserInterface &operator=(const UserInterface &) = delete;
2022-03-08 21:19:19 +03:30
virtual ~UserInterface() = default;
void init(GLFWwindow *windowHandle, Ref<SharedContext> sharedContext);
2022-03-08 21:19:19 +03:30
static void dockspace_begin();
2025-07-05 16:07:51 +03:30
static void dockspace_end();
2022-03-08 21:19:19 +03:30
virtual void platform_implementation(
2025-07-05 13:28:41 +03:30
GLFWwindow *windowHandle,
Ref<SharedContext> sharedContext
) = 0;
2022-03-08 21:19:19 +03:30
virtual void begin() = 0;
2025-07-05 16:07:51 +03:30
virtual void end() = 0;
2022-03-08 21:19:19 +03:30
virtual void log_debug_data() = 0;
2022-03-08 21:19:19 +03:30
protected:
UserInterface();
private:
2025-07-05 16:07:51 +03:30
static UserInterface *s_context;
void set_dark_theme_colors();
2025-07-05 16:07:51 +03:30
ImGuiWindowFlags m_dockspace_flags;
2022-03-08 21:19:19 +03:30
};
2025-07-05 13:28:41 +03:30
} // namespace Light