MCPcopy Create free account
hub / github.com/AlexandreRouma/SDRPlusPlus / AddText

Method AddText

core/src/imgui/imgui_draw.cpp:1562–1589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1560}
1561
1562void ImDrawList::AddText(const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end, float wrap_width, const ImVec4* cpu_fine_clip_rect)
1563{
1564 if ((col & IM_COL32_A_MASK) == 0)
1565 return;
1566
1567 if (text_end == NULL)
1568 text_end = text_begin + strlen(text_begin);
1569 if (text_begin == text_end)
1570 return;
1571
1572 // Pull default font/size from the shared ImDrawListSharedData instance
1573 if (font == NULL)
1574 font = _Data->Font;
1575 if (font_size == 0.0f)
1576 font_size = _Data->FontSize;
1577
1578 IM_ASSERT(font->ContainerAtlas->TexID == _CmdHeader.TextureId); // Use high-level ImGui::PushFont() or low-level ImDrawList::PushTextureId() to change font.
1579
1580 ImVec4 clip_rect = _CmdHeader.ClipRect;
1581 if (cpu_fine_clip_rect)
1582 {
1583 clip_rect.x = ImMax(clip_rect.x, cpu_fine_clip_rect->x);
1584 clip_rect.y = ImMax(clip_rect.y, cpu_fine_clip_rect->y);
1585 clip_rect.z = ImMin(clip_rect.z, cpu_fine_clip_rect->z);
1586 clip_rect.w = ImMin(clip_rect.w, cpu_fine_clip_rect->w);
1587 }
1588 font->RenderText(this, font_size, pos, col, clip_rect, text_begin, text_end, wrap_width, cpu_fine_clip_rect != NULL);
1589}
1590
1591void ImDrawList::AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end)
1592{

Callers 15

RenderTextMethod · 0.80
RenderTextWrappedMethod · 0.80
RenderTextClippedExMethod · 0.80
NavScoreItemMethod · 0.80
NavUpdateMethod · 0.80
ShowMetricsWindowMethod · 0.80
InputTextExMethod · 0.80
ShowDemoWindowLayoutFunction · 0.80
SNRMeterFunction · 0.80
drawFFTMethod · 0.80

Calls 4

ImMaxFunction · 0.85
ImMinFunction · 0.85
ImTextCharFromUtf8Function · 0.85
RenderTextMethod · 0.45

Tested by

no test coverage detected