Skip to content

Commit

Permalink
AddDockableWindowHelper called after frame 3
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Sep 21, 2024
1 parent cb89a2e commit e6c79d8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hello_imgui/internal/backend_impls/abstract_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,7 @@ void AbstractRunner::CreateFramesAndRender(bool insideReentrantCall)
}

// Handle AddDockableWindow(): this call should be done before ImGui::NewFrame
if (!insideReentrantCall)
if (!insideReentrantCall && mIdxFrame > 3)
AddDockableWindowHelper::Callback_2_PreNewFrame();

if ((params.callbacks.PreNewFrame) && !insideReentrantCall)
Expand All @@ -1354,7 +1354,8 @@ void AbstractRunner::CreateFramesAndRender(bool insideReentrantCall)
}

// Handle AddDockableWindow(): this call should be done when ImGui is accepting widgets
AddDockableWindowHelper::Callback_1_GuiRender();
if (mIdxFrame > 3)
AddDockableWindowHelper::Callback_1_GuiRender();

// iii/ At the end of the second frame, we measure the size of the widgets and use it as the application window size,
// if the user required auto size
Expand Down

0 comments on commit e6c79d8

Please sign in to comment.