19#define IMGUI_USER_CONFIG "engine/imconfig.h"
21#include <fmt/format.h>
23#include <imgui_node_editor.h>
24#include <imgui_stdlib.h>
31namespace ed = ax::NodeEditor;
35IMPLOT_API
void PlotPieChart(std::map<std::string, T>&,
double x,
double y,
double radius,
bool normalize =
false,
36 const char* label_fmt =
"%.1f",
double angle0 = 90);
40template <
typename... Args>
41IMGUI_API
void TextFmt(fmt::format_string<Args...> fmt, Args&&... args) {
42 auto s = fmt::format(fmt, std::forward<Args>(args)...);
43 Text(
"%s", s.c_str());
46template <
typename... Args>
47IMGUI_API
void TextFmtColored(
const ImVec4& color, fmt::format_string<Args...> fmt, Args&&... args) {
48 auto s = fmt::format(fmt, std::forward<Args>(args)...);
49 TextColored(color,
"%s", s.c_str());
52template <
typename... Args>
53IMGUI_API
bool SelectableFmt(fmt::format_string<Args...> fmt,
bool* p_selected, ImGuiSelectableFlags flags,
54 const ImVec2& size, Args&&... args) {
55 auto s = fmt::format(fmt, std::forward<Args>(args)...);
56 return Selectable(s.c_str(), p_selected, flags, size);
59template <
typename... Args>
60IMGUI_API
bool SelectableFmt(fmt::format_string<Args...> fmt,
bool* p_selected, ImGuiSelectableFlags flags,
62 auto s = fmt::format(fmt, std::forward<Args>(args)...);
63 return Selectable(s.c_str(), p_selected, flags, ImVec2(0, 0));
66template <
typename... Args>
67IMGUI_API
bool SelectableFmt(fmt::format_string<Args...> fmt,
bool* p_selected, Args&&... args) {
68 auto s = fmt::format(fmt, std::forward<Args>(args)...);
69 return Selectable(s.c_str(), p_selected, 0, ImVec2(0, 0));
76void DrawIcon(ImDrawList* drawList,
const ImVec2& a,
const ImVec2& b,
IconType type,
bool filled, ImU32 color,
79void Icon(
const ImVec2& size,
IconType type,
bool filled,
const ImVec4& color = ImVec4(1, 1, 1, 1),
80 const ImVec4& innerColor = ImVec4(0, 0, 0, 0));
IMGUI_API void TextFmt(fmt::format_string< Args... > fmt, Args &&... args)
Definition: gui.h:41
IMGUI_API void TextFmtColored(const ImVec4 &color, fmt::format_string< Args... > fmt, Args &&... args)
Definition: gui.h:47
IMGUI_API bool SelectableFmt(fmt::format_string< Args... > fmt, bool *p_selected, ImGuiSelectableFlags flags, const ImVec2 &size, Args &&... args)
Definition: gui.h:53
IMPLOT_API void PlotPieChart(std::map< std::string, T > &map, double x, double y, double radius, bool normalize, const char *fmt, double angle0)
Definition: gui.cpp:45
IconType
Definition: gui.h:74
void DrawIcon(ImDrawList *drawList, const ImVec2 &a, const ImVec2 &b, IconType type, bool filled, ImU32 color, ImU32 innerColor)
Definition: gui.cpp:155
void Icon(const ImVec2 &size, IconType type, bool filled, const ImVec4 &color=ImVec4(1, 1, 1, 1), const ImVec4 &innerColor=ImVec4(0, 0, 0, 0))
Definition: gui.cpp:294
@ Text
Definition: vfs.h:27