From b69b78ed213041a4cbc5d06fee09cbda1c57dd17 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 27 Mar 2026 09:57:29 +0000 Subject: Add wrapper for ImGui::TextEx for any contiguous char range --- ui/imgui_extras.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ui/imgui_extras.h') 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 +#include +#include +#include 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; + { std::to_address(text.end()) } -> std::convertible_to; + } + { + ImGui::TextEx(std::to_address(text.begin()), std::to_address(text.end()), flags); + } + // NOLINTEND(readability-identifier-naming) } -- cgit v1.3