Skip to content

Commit

Permalink
Internals: renamed GetIOEx() to GetIO(). Added GetPlatformIO() explic…
Browse files Browse the repository at this point in the history
…it context variant.
  • Loading branch information
ocornut committed Jan 31, 2025
1 parent dbb5eea commit e2a99b5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4814,7 +4814,7 @@ ImGuiIO& ImGui::GetIO()
}

// This variant exists to facilitate backends experimenting with multi-threaded parallel context. (#8069, #6293, #5856)
ImGuiIO& ImGui::GetIOEx(ImGuiContext* ctx)
ImGuiIO& ImGui::GetIO(ImGuiContext* ctx)
{
IM_ASSERT(ctx != NULL);
return ctx->IO;
Expand All @@ -4826,6 +4826,13 @@ ImGuiPlatformIO& ImGui::GetPlatformIO()
return GImGui->PlatformIO;
}

// This variant exists to facilitate backends experimenting with multi-threaded parallel context. (#8069, #6293, #5856)
ImGuiPlatformIO& ImGui::GetPlatformIO(ImGuiContext* ctx)
{
IM_ASSERT(ctx != NULL;
return ctx->PlatformIO;
}

// Pass this to your backend rendering function! Valid after Render() and until the next call to NewFrame()
ImDrawData* ImGui::GetDrawData()
{
Expand Down
3 changes: 2 additions & 1 deletion imgui_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -2980,7 +2980,8 @@ namespace ImGui
// If this ever crashes because g.CurrentWindow is NULL, it means that either:
// - ImGui::NewFrame() has never been called, which is illegal.
// - You are calling ImGui functions after ImGui::EndFrame()/ImGui::Render() and before the next ImGui::NewFrame(), which is also illegal.
IMGUI_API ImGuiIO& GetIOEx(ImGuiContext* ctx);
IMGUI_API ImGuiIO& GetIO(ImGuiContext* ctx);
IMGUI_API ImGuiPlatformIO& GetPlatformIO(ImGuiContext* ctx);
inline ImGuiWindow* GetCurrentWindowRead() { ImGuiContext& g = *GImGui; return g.CurrentWindow; }
inline ImGuiWindow* GetCurrentWindow() { ImGuiContext& g = *GImGui; g.CurrentWindow->WriteAccessed = true; return g.CurrentWindow; }
IMGUI_API ImGuiWindow* FindWindowByID(ImGuiID id);
Expand Down

0 comments on commit e2a99b5

Please sign in to comment.