From 78e14b4beebedeae8a851fa4b7a7c49fbd2d7270 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 29 Jul 2018 22:11:47 +0200 Subject: [PATCH] Skip rendering if viewer window is minimized. --- standalone/src/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/standalone/src/main.cpp b/standalone/src/main.cpp index 5240a1bc..a495ca2a 100644 --- a/standalone/src/main.cpp +++ b/standalone/src/main.cpp @@ -113,6 +113,13 @@ int main( int argc, char** argv ) while (!glfwWindowShouldClose(window)) { glfwPollEvents(); + + if( glfwGetWindowAttrib( window, GLFW_ICONIFIED ) ) + { + std::this_thread::sleep_for( std::chrono::milliseconds( 50 ) ); + continue; + } + ImGui_ImplGlfwGL3_NewFrame(); if( !view )