Skip to content

Commit

Permalink
Added GetID(int) variant for consistency. (#7111)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Jul 26, 2024
1 parent b3ba6b3 commit 692bee5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ Other changes:
- Groups, Tables: fixed EndGroup() failing to correctly capture current table occupied size. (#7543)
- TabBar, Style: added style.TabBarOverlineSize / ImGuiStyleVar_TabBarOverlineSize to manipulate
thickness of the horizontal line over selectable tabs. [@DctrNoob]
- Misc: added GetID(int) variant for consistency. (#7111)
- Style: close button and collapse/window-menu button hover highlight made rectangular instead of round.
- Debug Tools: Added IMGUI_DEBUG_LOG(), ImGui::DebugLog() in public API. (#5855)
Debug log entries add a imgui frame counter prefix + are redirected to ShowDebugLogWindow() and
Expand Down
5 changes: 5 additions & 0 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8380,6 +8380,11 @@ ImGuiID ImGui::GetID(const void* ptr_id)
return window->GetID(ptr_id);
}

ImGuiID ImGui::GetID(int int_id)
{
ImGuiWindow* window = GImGui->CurrentWindow;
return window->GetID(int_id);
}
//-----------------------------------------------------------------------------
// [SECTION] INPUTS
//-----------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ namespace ImGui
IMGUI_API ImGuiID GetID(const char* str_id); // calculate unique ID (hash of whole ID stack + given parameter). e.g. if you want to query into ImGuiStorage yourself
IMGUI_API ImGuiID GetID(const char* str_id_begin, const char* str_id_end);
IMGUI_API ImGuiID GetID(const void* ptr_id);
IMGUI_API ImGuiID GetID(int int_id);

// Widgets: Text
IMGUI_API void TextUnformatted(const char* text, const char* text_end = NULL); // raw text without formatting. Roughly equivalent to Text("%s", text) but: A) doesn't require null terminated string if 'text_end' is specified, B) it's faster, no memory copy is done, no buffer size limits, recommended for long chunks of text.
Expand Down

0 comments on commit 692bee5

Please sign in to comment.