Internal ImGui functions to render text RenderText***() functions calls ImDrawList::AddText() calls ImBitmapFont::RenderText()
| 3261 | // Internal ImGui functions to render text |
| 3262 | // RenderText***() functions calls ImDrawList::AddText() calls ImBitmapFont::RenderText() |
| 3263 | void ImGui::RenderText(ImVec2 pos, const char* text, const char* text_end, bool hide_text_after_hash) |
| 3264 | { |
| 3265 | ImGuiContext& g = *GImGui; |
| 3266 | ImGuiWindow* window = g.CurrentWindow; |
| 3267 | |
| 3268 | // Hide anything after a '##' string |
| 3269 | const char* text_display_end; |
| 3270 | if (hide_text_after_hash) |
| 3271 | { |
| 3272 | text_display_end = FindRenderedTextEnd(text, text_end); |
| 3273 | } |
| 3274 | else |
| 3275 | { |
| 3276 | if (!text_end) |
| 3277 | text_end = text + strlen(text); // FIXME-OPT |
| 3278 | text_display_end = text_end; |
| 3279 | } |
| 3280 | |
| 3281 | if (text != text_display_end) |
| 3282 | { |
| 3283 | window->DrawList->AddText(g.Font, g.FontSize, pos, GetColorU32(ImGuiCol_Text), text, text_display_end); |
| 3284 | if (g.LogEnabled) |
| 3285 | LogRenderedText(&pos, text, text_display_end); |
| 3286 | } |
| 3287 | } |
| 3288 | |
| 3289 | void ImGui::RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width) |
| 3290 | { |