light/modules/ui/public/ui.hpp

53 lines
913 B
C++
Raw Normal View History

2022-03-08 21:19:19 +03:30
#pragma once
#include <imgui.h>
struct GLFWwindow;
2025-07-11 00:05:48 +03:30
namespace lt {
2022-03-08 21:19:19 +03:30
class Event;
class SharedContext;
class UserInterface
2022-03-08 21:19:19 +03:30
{
public:
static auto create(GLFWwindow *windowHandle, Ref<SharedContext> sharedContext)
2025-07-06 14:02:50 +03:30
-> Scope<UserInterface>;
static void dockspace_begin();
static void dockspace_end();
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-06 14:02:50 +03:30
auto operator=(const UserInterface &) -> 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
virtual void platform_implementation(
GLFWwindow *window_handle,
2025-07-05 13:28:41 +03:30
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-11 00:05:48 +03:30
} // namespace lt