MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / ImFontAtlasBuildRender32bppRectFromString

Function ImFontAtlasBuildRender32bppRectFromString

KBotExt/imgui/imgui_draw.cpp:2709–2717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2707}
2708
2709void ImFontAtlasBuildRender32bppRectFromString(ImFontAtlas* atlas, int x, int y, int w, int h, const char* in_str, char in_marker_char, unsigned int in_marker_pixel_value)
2710{
2711 IM_ASSERT(x >= 0 && x + w <= atlas->TexWidth);
2712 IM_ASSERT(y >= 0 && y + h <= atlas->TexHeight);
2713 unsigned int* out_pixel = atlas->TexPixelsRGBA32 + x + (y * atlas->TexWidth);
2714 for (int off_y = 0; off_y < h; off_y++, out_pixel += atlas->TexWidth, in_str += w)
2715 for (int off_x = 0; off_x < w; off_x++)
2716 out_pixel[off_x] = (in_str[off_x] == in_marker_char) ? in_marker_pixel_value : IM_COL32_BLACK_TRANS;
2717}
2718
2719static void ImFontAtlasBuildRenderDefaultTexData(ImFontAtlas* atlas)
2720{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected