galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
ImGuiHelpers.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_UI_IMGUIHELPERS_HPP_
9#define GALAXY_UI_IMGUIHELPERS_HPP_
10
11#include <functional>
12
13#include <glm/vec2.hpp>
14#include <glm/vec3.hpp>
15#include <glm/vec4.hpp>
16#include <imgui/imgui_stdlib.h>
17
18#include "galaxy/math/Rect.hpp"
19
20namespace galaxy
21{
22 namespace graphics
23 {
24 class Texture2D;
25 class RenderTexture;
26 } // namespace graphics
27
28 namespace ui
29 {
37 [[maybe_unused]]
38 ImGuiIO& imgui_init_context(const char* ini);
39
43 void imgui_new_frame();
44
48 void imgui_render();
49
54
58 void imgui_set_theme();
59
67 void imgui_popup(const char* id, bool& open, std::move_only_function<void(void)>&& func);
68
76 void imgui_confirm(const char* msg, std::move_only_function<void(void)>&& yes = {}, std::move_only_function<void(void)>&& no = {});
77
82
89
95 [[nodiscard]]
96 bool imgui_loaded();
97
108 [[maybe_unused]]
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));
110
117 void imgui_image(const graphics::Texture2D& texture, const ImVec2& size);
118
125 void imgui_image(const graphics::RenderTexture& texture, const ImVec2& size);
126
132 void imgui_notify_success(const char* msg);
133
139 void imgui_notify_info(const char* msg);
140
146 void imgui_notify_warning(const char* msg);
147
153 void imgui_notify_error(const char* msg);
154
163 [[maybe_unused]]
164 bool imgui_glm_vec2(const char* label, glm::vec2& vec);
165
174 [[maybe_unused]]
175 bool imgui_glm_vec3(const char* label, glm::vec3& vec);
176
185 [[maybe_unused]]
186 bool imgui_glm_vec4(const char* label, glm::vec4& vec);
187
196 [[maybe_unused]]
197 bool imgui_frect(const char* label, math::fRect& rect);
198 } // namespace ui
199} // namespace galaxy
200
201#endif
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.
Timer.hpp galaxy.
Definition Async.hpp:17