3#include "entt/entity/fwd.hpp"
4#include <engine/engine_export.h>
8#include <hpp/utility.hpp>
13#include <entt/entt.hpp>
21 class ElementDocument;
28 struct ui_document_component;
122 const camera& cam,
float dp_ratio,
bool process_input,
bool& hit_found);
135 int viewport_height,
float dp_ratio,
scene& scn,
bool process_input,
bool& hit_found);
174 Rml::Context* debug_context_ =
nullptr;
175 Rml::Context* debug_target_context_ =
nullptr;
176 std::shared_ptr<RmlUi_RenderLayerStack> debug_render_layer_stack_ =
nullptr;
179 std::shared_ptr<int> sentinel_ = std::make_shared<int>();
180 std::set<std::string> fonts_loaded_;
std::shared_ptr< frame_buffer > ptr
Class representing a camera. Contains functionality for manipulating and updating a camera....
std::chrono::duration< float > delta_t
Represents a scene in the ACE framework, managing entities and their relationships.
Component that holds a reference to a UI document for RmlUi rendering.
Rml::Context * target_context
System responsible for managing user interface components and rendering.
void on_os_event(rtti::context &ctx, os::event &event)
Handle OS events and forward to RmlUi.
void update_world_space(rtti::context &ctx, entt::handle camera_entity, scene &scn, bool &process_input)
Update world-space UI documents (common + world-space specific). Call before render_world_space.
auto init(rtti::context &ctx) -> bool
Initializes the UI system with the given context.
auto try_consume_keyboard_event(scene &scn, os::event &event) -> bool
void render_screen_space(rtti::context &ctx, const gfx::frame_buffer::ptr &output, entt::handle camera_entity, scene &scn, delta_t dt)
Render screen-space overlay UI documents to output. Call after update_screen_space.
static void on_create_component(entt::registry &r, entt::entity e)
void update_screen_space(rtti::context &ctx, entt::handle camera_entity, scene &scn, bool &process_input)
Update screen-space UI documents (common + screen-space specific). Call before render_screen_space.
void apply_mouse_press_focus(scene &scn, os::event &event, Rml::Context *target_context, bool input_allowed)
static void on_load_component(entt::registry &r, entt::entity e)
void update_ui_document_common(entt::handle handle, ui_document_component &ui_comp, bool is_playing)
void update_ui_documents(rtti::context &ctx, scene &scn)
Update UI documents (load, reload, visibility). No camera dependency.
auto process_mouse_move(scene &scn, Rml::Context *context, int x, int y) -> bool
void set_debugger_enabled(bool enabled)
void render_world_space(rtti::context &ctx, entt::handle camera_entity, scene &scn, delta_t dt)
Render world-space UI documents (sort + frame-state render). Call after update_world_space.
auto find_keyboard_context(scene &scn) const -> Rml::Context *
void blur_ui_context(Rml::Context *context) const
auto dispatch_pointer_event(rtti::context &ctx, scene &scn, os::event &event) -> ui_pointer_dispatch_result
static void on_destroy_component(entt::registry &r, entt::entity e)
auto deinit(rtti::context &ctx) -> bool
Deinitializes the UI system with the given context.
auto is_debugger_enabled() const -> bool
void refresh_mouse_state(rtti::context &ctx, scene &scn)
void ensure_document_framebuffer(ui_document_component &comp)
Ensure framebuffer exists for document; create or resize if needed.
void register_component_callbacks(rtti::context &ctx)
Register component creation/destruction callbacks with ECS.
void update_screen_space_document(rtti::context &ctx, Rml::Context *context, int viewport_width, int viewport_height, float dp_ratio, scene &scn, bool process_input, bool &hit_found)
Update a single screen-space document (dimensions, density, input). Call from render path.
auto is_not_root_element(scene &scn, Rml::Element *element) -> bool
void load_fonts()
Load fonts.
void update_world_space_document(rtti::context &ctx, scene &scn, entt::handle handle, ui_document_component &comp, const camera &cam, float dp_ratio, bool process_input, bool &hit_found)
Update a single world-space document (dimensions, density, input). Call from render path,...
auto process_event(scene &scn, Rml::Context *context, os::event &event) -> bool
void load_font(const std::string &path)
auto load_ui_document(entt::handle entity, ui_document_component &component, bool log_error=true) -> bool
Load a UI document for a specific component.