mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Examples: GLFW: rework examples main loop to handle minimization without burning CPU or GPU by running unthrottled code. (#7844)
Backends: GLFW: added ImGui_ImplGlfw_Sleep() helper.
This commit is contained in:
parent
887478793b
commit
71ee2ce367
6 changed files with 36 additions and 2 deletions
|
|
@ -91,6 +91,11 @@ int main(int, char**)
|
|||
// - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application, or clear/overwrite your copy of the keyboard data.
|
||||
// Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags.
|
||||
glfwPollEvents();
|
||||
if (glfwGetWindowAttrib(window, GLFW_ICONIFIED) != 0)
|
||||
{
|
||||
ImGui_ImplGlfw_Sleep(10);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Start the Dear ImGui frame
|
||||
ImGui_ImplOpenGL2_NewFrame();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue