mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-24 02:14:22 +00:00
Internal: Refactored internal RenderMouseCursor so colors can be specified. (#2614)
This commit is contained in:
parent
25849234f6
commit
52deb415e0
3 changed files with 3 additions and 7 deletions
|
|
@ -3038,16 +3038,12 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
|
|||
// - RenderRectFilledRangeH()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void ImGui::RenderMouseCursor(ImDrawList* draw_list, ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor)
|
||||
void ImGui::RenderMouseCursor(ImDrawList* draw_list, ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow)
|
||||
{
|
||||
if (mouse_cursor == ImGuiMouseCursor_None)
|
||||
return;
|
||||
IM_ASSERT(mouse_cursor > ImGuiMouseCursor_None && mouse_cursor < ImGuiMouseCursor_COUNT);
|
||||
|
||||
const ImU32 col_shadow = IM_COL32(0, 0, 0, 48);
|
||||
const ImU32 col_border = IM_COL32(0, 0, 0, 255); // Black
|
||||
const ImU32 col_fill = IM_COL32(255, 255, 255, 255); // White
|
||||
|
||||
ImFontAtlas* font_atlas = draw_list->_Data->Font->ContainerAtlas;
|
||||
ImVec2 offset, size, uv[4];
|
||||
if (font_atlas->GetMouseCursorTexData(mouse_cursor, &offset, &size, &uv[0], &uv[2]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue