8#ifndef GALAXY_UI_IMGUIHELPERS_HPP_
9#define GALAXY_UI_IMGUIHELPERS_HPP_
13#include <glm/vec2.hpp>
14#include <glm/vec3.hpp>
15#include <glm/vec4.hpp>
16#include <imgui/imgui_stdlib.h>
18#include "galaxy/math/Rect.hpp"
67 void imgui_popup(
const char*
id,
bool& open, std::move_only_function<
void(
void)>&& func);
76 void imgui_confirm(
const char* msg, std::move_only_function<
void(
void)>&& yes = {}, std::move_only_function<void(
void)>&& no = {});
109 bool imgui_imagebutton(
const graphics::Texture2D& texture,
const ImVec2& size,
const ImVec4& bg_col = ImVec4(0, 0, 0, 0),
const ImVec4& tint_col = ImVec4(1, 1, 1, 1));
117 void imgui_image(
const graphics::Texture2D& texture,
const ImVec2& size);
125 void imgui_image(
const graphics::RenderTexture& texture,
const ImVec2& size);
197 bool imgui_frect(
const char* label, math::fRect& rect);
bool imgui_glm_vec2(const char *label, glm::vec2 &vec)
GLM vector 2 widget.
void imgui_notify_error(const char *msg)
ImGui error notification.
void imgui_set_theme()
Set our theme.
bool imgui_loaded()
Is ImGui loaded?
bool imgui_imagebutton(const graphics::Texture2D &texture, const ImVec2 &size, const ImVec4 &bg_col, const ImVec4 &tint_col)
Render an imgui image button with a galaxy texture.
bool imgui_glm_vec3(const char *label, glm::vec3 &vec)
GLM vector 3 widget.
void imgui_image(const graphics::Texture2D &texture, const ImVec2 &size)
Display a galaxy image with imgui.
void imgui_new_frame()
New imgui frame with galaxy.
void imgui_popup(const char *id, bool &open, std::move_only_function< void(void)> &&func)
Cleaner way of rendering an ImGui popup.
void imgui_center_next_window()
Make sure the next window opened is centered on the monitor.
ImGuiIO & imgui_init_context(const char *ini)
Initialize ImGui context with galaxy.
void imgui_notify_success(const char *msg)
ImGui success notification.
void imgui_destroy_context()
Cleanup imgui resources used by galaxy.
bool imgui_glm_vec4(const char *label, glm::vec4 &vec)
GLM vector 4 widget.
void scale_and_load_fonts()
Scale and load fonts.
void imgui_confirm(const char *msg, std::move_only_function< void(void)> &&yes, std::move_only_function< void(void)> &&no)
Handles a popup for a yes/no situation.
void imgui_notify_info(const char *msg)
ImGui info notification.
void imgui_notify_warning(const char *msg)
ImGui warning notification.
void imgui_render()
Render imgui with galaxy.
bool imgui_frect(const char *label, math::fRect &rect)
fRect widget.