Internal ImGui functions to render text RenderText***() functions calls ImDrawList::AddText() calls ImBitmapFont::RenderText()
| 3210 | // Internal ImGui functions to render text |
| 3211 | // RenderText***() functions calls ImDrawList::AddText() calls ImBitmapFont::RenderText() |
| 3212 | void ImGui::RenderText(ImVec2 pos, const char* text, const char* text_end, bool hide_text_after_hash) |
| 3213 | { |
| 3214 | ImGuiContext& g = *GImGui; |
| 3215 | ImGuiWindow* window = g.CurrentWindow; |
| 3216 | |
| 3217 | // Hide anything after a '##' string |
| 3218 | const char* text_display_end; |
| 3219 | if (hide_text_after_hash) |
| 3220 | { |
| 3221 | text_display_end = FindRenderedTextEnd(text, text_end); |
| 3222 | } |
| 3223 | else |
| 3224 | { |
| 3225 | if (!text_end) |
| 3226 | text_end = text + strlen(text); // FIXME-OPT |
| 3227 | text_display_end = text_end; |
| 3228 | } |
| 3229 | |
| 3230 | if (text != text_display_end) |
| 3231 | { |
| 3232 | window->DrawList->AddText(g.Font, g.FontSize, pos, GetColorU32(ImGuiCol_Text), text, text_display_end); |
| 3233 | if (g.LogEnabled) |
| 3234 | LogRenderedText(&pos, text, text_display_end); |
| 3235 | } |
| 3236 | } |
| 3237 | |
| 3238 | void ImGui::RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width) |
| 3239 | { |