Internal ImGui functions to render text RenderText***() functions calls ImDrawList::AddText() calls ImBitmapFont::RenderText()
| 3722 | // Internal ImGui functions to render text |
| 3723 | // RenderText***() functions calls ImDrawList::AddText() calls ImBitmapFont::RenderText() |
| 3724 | void ImGui::RenderText(ImVec2 pos, const char* text, const char* text_end, bool hide_text_after_hash) |
| 3725 | { |
| 3726 | ImGuiContext& g = *GImGui; |
| 3727 | ImGuiWindow* window = g.CurrentWindow; |
| 3728 | |
| 3729 | // Hide anything after a '##' string |
| 3730 | const char* text_display_end; |
| 3731 | if (hide_text_after_hash) |
| 3732 | { |
| 3733 | text_display_end = FindRenderedTextEnd(text, text_end); |
| 3734 | } |
| 3735 | else |
| 3736 | { |
| 3737 | if (!text_end) |
| 3738 | text_end = text + ImStrlen(text); // FIXME-OPT |
| 3739 | text_display_end = text_end; |
| 3740 | } |
| 3741 | |
| 3742 | if (text != text_display_end) |
| 3743 | { |
| 3744 | window->DrawList->AddText(g.Font, g.FontSize, pos, GetColorU32(ImGuiCol_Text), text, text_display_end); |
| 3745 | if (g.LogEnabled) |
| 3746 | LogRenderedText(&pos, text, text_display_end); |
| 3747 | } |
| 3748 | } |
| 3749 | |
| 3750 | void ImGui::RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width) |
| 3751 | { |