Skip to content

Commit

Permalink
Merge pull request #2242 from totalgee/imgui_multiWin_fix
Browse files Browse the repository at this point in the history
Fix glitches when using ImGui in an app with multiple windows
  • Loading branch information
richardeakin committed May 10, 2021
2 parents bb15730 + 30519cc commit 51adfb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cinder/CinderImGui.cpp
Expand Up @@ -457,7 +457,7 @@ static void ImGui_ImplCinder_NewFrameGuard( const ci::app::WindowRef& window ) {
IM_ASSERT( io.Fonts->IsBuilt() ); // Font atlas needs to be built, call renderer _NewFrame() function e.g. ImGui_ImplOpenGL3_NewFrame()

// Setup display size
io.DisplaySize = ci::app::toPixels( window->getSize() );
io.DisplaySize = window->toPixels( window->getSize() );

// Setup time step
static double g_Time = 0.0f;
Expand Down Expand Up @@ -559,7 +559,7 @@ bool ImGui::Initialize( const ImGui::Options& options )
if( options.isKeyboardEnabled() ) io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
if( options.isGamepadEnabled() ) io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
ci::app::WindowRef window = options.getWindow();
io.DisplaySize = ci::vec2( ci::app::toPixels( window->getSize() ) );
io.DisplaySize = ci::vec2( window->toPixels( window->getSize() ) );
io.DeltaTime = 1.0f / 60.0f;
io.WantCaptureMouse = true;

Expand Down

0 comments on commit 51adfb1

Please sign in to comment.