Skip to content

Commit

Permalink
imgui_keybindmenu: merge change from Dear ImGui 1.91.2 sdl2+opengl sa…
Browse files Browse the repository at this point in the history
…mple

no changes were necessary for the 1.90.6 -> 1.91.2 update, but
the sample code it's based on  now sleeps a bit if the window is
minimized, so do the same
  • Loading branch information
DanielGibson committed Oct 2, 2024
1 parent 993ec23 commit 2d3d780
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions imgui_keybindmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
* but I added some hacks in the SDL2-specific code (gamepadStartPressed and hadKeyDownEvent)
* that must be ported for different input backends.
*
* To build, you also need the following source files from Dear ImGui 1.90.6 (other versions might
* work, but this has been developed for and tested with 1.90.6):
* To build, you also need the following source files from Dear ImGui 1.90.6 or 1.91.2 (other versions
* might work, but those have been tested):
* imgui.cpp imgui_demo.cpp imgui_draw.cpp imgui_tables.cpp imgui_widgets.cpp
* backends/imgui_impl_sdl2.cpp backends/imgui_impl_opengl2.cpp
* Furthermore you need to add the imgui root directory (that contains imgui.h) and its backends/
Expand Down Expand Up @@ -1484,6 +1484,11 @@ int main(int, char**)
if (event.type == SDL_WINDOWEVENT && event.window.event == SDL_WINDOWEVENT_CLOSE && event.window.windowID == SDL_GetWindowID(window))
done = true;
}
if (SDL_GetWindowFlags(window) & SDL_WINDOW_MINIMIZED)
{
SDL_Delay(10);
continue;
}

// Start the Dear ImGui frame
ImGui_ImplOpenGL2_NewFrame();
Expand Down

0 comments on commit 2d3d780

Please sign in to comment.