mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 14:10:06 +00:00
Support events over multiple ImGui contexts
This commit is contained in:
parent
f27e2534a7
commit
fcb89926ca
2 changed files with 16 additions and 1 deletions
|
|
@ -75,7 +75,22 @@ std::string ImGuiDebugWidget::context_name() const
|
|||
|
||||
void ImGuiDebugWidget::set_current_context(ImGuiContext* context)
|
||||
{
|
||||
if (context == p->currentContext_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Unregister widget with current context
|
||||
ImGui::SetCurrentContext(p->currentContext_);
|
||||
ImGui_ImplQt_UnregisterWidget(this);
|
||||
|
||||
p->currentContext_ = context;
|
||||
|
||||
// Register widget with new context
|
||||
ImGui::SetCurrentContext(context);
|
||||
ImGui_ImplQt_RegisterWidget(this);
|
||||
|
||||
// Queue an update
|
||||
update();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue