MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / RenderMouseCursor

Method RenderMouseCursor

lib/imgui/imgui_draw.cpp:3146–3165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3144//-----------------------------------------------------------------------------
3145
3146void ImGui::RenderMouseCursor(ImDrawList* draw_list, ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow)
3147{
3148 if (mouse_cursor == ImGuiMouseCursor_None)
3149 return;
3150 IM_ASSERT(mouse_cursor > ImGuiMouseCursor_None && mouse_cursor < ImGuiMouseCursor_COUNT);
3151
3152 ImFontAtlas* font_atlas = draw_list->_Data->Font->ContainerAtlas;
3153 ImVec2 offset, size, uv[4];
3154 if (font_atlas->GetMouseCursorTexData(mouse_cursor, &offset, &size, &uv[0], &uv[2]))
3155 {
3156 pos -= offset;
3157 const ImTextureID tex_id = font_atlas->TexID;
3158 draw_list->PushTextureID(tex_id);
3159 draw_list->AddImage(tex_id, pos + ImVec2(1,0)*scale, pos + ImVec2(1,0)*scale + size*scale, uv[2], uv[3], col_shadow);
3160 draw_list->AddImage(tex_id, pos + ImVec2(2,0)*scale, pos + ImVec2(2,0)*scale + size*scale, uv[2], uv[3], col_shadow);
3161 draw_list->AddImage(tex_id, pos, pos + size*scale, uv[2], uv[3], col_border);
3162 draw_list->AddImage(tex_id, pos, pos + size*scale, uv[0], uv[1], col_fill);
3163 draw_list->PopTextureID();
3164 }
3165}
3166
3167// Render an arrow. 'pos' is position of the arrow tip. half_sz.x is length from base to tip. half_sz.y is length on each side.
3168void ImGui::RenderArrowPointingAt(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, ImGuiDir direction, ImU32 col)

Callers

nothing calls this directly

Calls 5

ImVec2Class · 0.85
GetMouseCursorTexDataMethod · 0.80
PushTextureIDMethod · 0.80
AddImageMethod · 0.80
PopTextureIDMethod · 0.80

Tested by

no test coverage detected