Internals: add SetContextName() helper. (#9097)

Amend 37c243b.
This commit is contained in:
ocornut
2025-11-26 17:29:37 +01:00
parent f0699effed
commit c36162fc6c
2 changed files with 13 additions and 5 deletions

View File

@@ -4443,6 +4443,13 @@ void ImGui::Shutdown()
g.Initialized = false;
}
// When using multiple context it can be helpful to give name a name.
// (A) Will be visible in debugger, (B) Will be included in all IMGUI_DEBUG_LOG() calls, (C) Should be <= 15 characters long.
void ImGui::SetContextName(ImGuiContext* ctx, const char* name)
{
ImStrncpy(ctx->ContextName, name, IM_ARRAYSIZE(ctx->ContextName));
}
// No specific ordering/dependency support, will see as needed
ImGuiID ImGui::AddContextHook(ImGuiContext* ctx, const ImGuiContextHook* hook)
{