diff options
| author | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2026-03-27 09:57:29 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2026-03-27 09:57:29 +0000 |
| commit | b69b78ed213041a4cbc5d06fee09cbda1c57dd17 (patch) | |
| tree | 65d398c92f3dee2ebcf71d6255fe39f9dd6f2f45 /ui | |
| parent | Improve calculations of the amount and colour of ambient and directional sun ... (diff) | |
| download | ilt-b69b78ed213041a4cbc5d06fee09cbda1c57dd17.tar.bz2 ilt-b69b78ed213041a4cbc5d06fee09cbda1c57dd17.tar.xz ilt-b69b78ed213041a4cbc5d06fee09cbda1c57dd17.zip | |
Add wrapper for ImGui::TextEx for any contiguous char range
Diffstat (limited to 'ui')
| -rw-r--r-- | ui/imgui_extras.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ui/imgui_extras.h b/ui/imgui_extras.h index b27bc17..8b87b28 100644 --- a/ui/imgui_extras.h +++ b/ui/imgui_extras.h @@ -1,4 +1,7 @@ #include <imgui.h> +#include <imgui_internal.h> +#include <memory> +#include <ranges> namespace IltGui { // NOLINTBEGIN(readability-identifier-naming) @@ -6,5 +9,16 @@ namespace IltGui { ImGuiWindowFlags windowFlags = 0); bool BeginToolbar(const char * name, ImGuiDir dir, float axisSize, ImGuiWindowFlags windowFlags = 0); void EndToolbar(); + + void + Text(std::ranges::contiguous_range auto text, ImGuiTextFlags flags = ImGuiTextFlags_None) + requires requires { + { std::to_address(text.begin()) } -> std::convertible_to<const char *>; + { std::to_address(text.end()) } -> std::convertible_to<const char *>; + } + { + ImGui::TextEx(std::to_address(text.begin()), std::to_address(text.end()), flags); + } + // NOLINTEND(readability-identifier-naming) } |
