8#ifndef GALAXY_UI_NUKLEARUI_HPP_
9#define GALAXY_UI_NUKLEARUI_HPP_
11#include <ankerl/unordered_dense.h>
14#include "galaxy/events/ContentScale.hpp"
15#include "galaxy/events/KeyChar.hpp"
16#include "galaxy/events/KeyPress.hpp"
17#include "galaxy/events/MousePressed.hpp"
18#include "galaxy/events/MouseWheel.hpp"
105 void set_font(
const std::string&
id);
133 [[nodiscard]] nk_context*
ctx()
const;
162 ankerl::unordered_dense::map<std::string, nk_font*>
m_fonts;
Manages the nuklear ui state.
void on_mouse_pressed(events::MousePressed &e)
On mouse pressed event handler.
void show_building_atlas()
Part of the loading screen. Informs the user that the atlas is being built.
void on_mouse_wheel(events::MouseWheel &e)
On mouse wheel event handler.
void poll_input() const
Calls begin, end and glfwPollEvents.
void toggle_input(const bool enable)
Control the input.
void show_loading_bar(const char *text, nk_size total, nk_size current)
Shows a progress bar for loading screens.
void on_key_press(events::KeyPress &e)
On keyboad press event.
void end_input() const
Called after glfwPollEvents.
void scale(const float scale)
Scale UI to monitor/window.
void on_content_scale(const events::ContentScale &e)
On content scale event.
void on_key_char(events::KeyChar &e)
On typing event handler.
nk_context * ctx() const
Nuklear Context.
nk_font_atlas * m_atlas
Nuklear atlas pointer.
ankerl::unordered_dense::map< std::string, nk_font * > m_fonts
Fonts used by nuklear.
void begin_input() const
Called before glfwPollEvents.
nk_glfw * m_ctx
Nuklear context pointer.
void new_frame()
Called before any nuklear code.
void render()
Render nuklear.
std::array< int, 4 > m_viewport_backup
Viewport backup when rendering.
void set_font(const std::string &id)
Change the active font.