MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / GetMouseCursorTexData

Method GetMouseCursorTexData

plugins/Cardinal/src/DearImGui/imgui_draw.cpp:2239–2258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2237}
2238
2239bool ImFontAtlas::GetMouseCursorTexData(ImGuiMouseCursor cursor_type, ImVec2* out_offset, ImVec2* out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2])
2240{
2241 if (cursor_type <= ImGuiMouseCursor_None || cursor_type >= ImGuiMouseCursor_COUNT)
2242 return false;
2243 if (Flags & ImFontAtlasFlags_NoMouseCursors)
2244 return false;
2245
2246 IM_ASSERT(PackIdMouseCursors != -1);
2247 ImFontAtlasCustomRect* r = GetCustomRectByIndex(PackIdMouseCursors);
2248 ImVec2 pos = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][0] + ImVec2((float)r->X, (float)r->Y);
2249 ImVec2 size = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][1];
2250 *out_size = size;
2251 *out_offset = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][2];
2252 out_uv_border[0] = (pos) * TexUvScale;
2253 out_uv_border[1] = (pos + size) * TexUvScale;
2254 pos.x += FONT_ATLAS_DEFAULT_TEX_DATA_W + 1;
2255 out_uv_fill[0] = (pos) * TexUvScale;
2256 out_uv_fill[1] = (pos + size) * TexUvScale;
2257 return true;
2258}
2259
2260bool ImFontAtlas::Build()
2261{

Callers 1

RenderMouseCursorMethod · 0.80

Calls 1

ImVec2Function · 0.85

Tested by

no test coverage detected