MCPcopy Create free account
hub / github.com/RenderKit/embree / GetMouseCursorTexData

Method GetMouseCursorTexData

tutorials/common/imgui/imgui_draw.cpp:2230–2249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2228}
2229
2230bool ImFontAtlas::GetMouseCursorTexData(ImGuiMouseCursor cursor_type, ImVec2* out_offset, ImVec2* out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2])
2231{
2232 if (cursor_type <= ImGuiMouseCursor_None || cursor_type >= ImGuiMouseCursor_COUNT)
2233 return false;
2234 if (Flags & ImFontAtlasFlags_NoMouseCursors)
2235 return false;
2236
2237 IM_ASSERT(PackIdMouseCursors != -1);
2238 ImFontAtlasCustomRect* r = GetCustomRectByIndex(PackIdMouseCursors);
2239 ImVec2 pos = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][0] + ImVec2((float)r->X, (float)r->Y);
2240 ImVec2 size = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][1];
2241 *out_size = size;
2242 *out_offset = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][2];
2243 out_uv_border[0] = (pos) * TexUvScale;
2244 out_uv_border[1] = (pos + size) * TexUvScale;
2245 pos.x += FONT_ATLAS_DEFAULT_TEX_DATA_W + 1;
2246 out_uv_fill[0] = (pos) * TexUvScale;
2247 out_uv_fill[1] = (pos + size) * TexUvScale;
2248 return true;
2249}
2250
2251bool ImFontAtlas::Build()
2252{

Callers 1

RenderMouseCursorMethod · 0.80

Calls 1

ImVec2Function · 0.85

Tested by

no test coverage detected