Skip rendering if viewer window is minimized.

This commit is contained in:
Bartosz Taudul 2018-07-29 22:11:47 +02:00
parent 43255b01fa
commit 78e14b4bee

View File

@ -113,6 +113,13 @@ int main( int argc, char** argv )
while (!glfwWindowShouldClose(window)) while (!glfwWindowShouldClose(window))
{ {
glfwPollEvents(); glfwPollEvents();
if( glfwGetWindowAttrib( window, GLFW_ICONIFIED ) )
{
std::this_thread::sleep_for( std::chrono::milliseconds( 50 ) );
continue;
}
ImGui_ImplGlfwGL3_NewFrame(); ImGui_ImplGlfwGL3_NewFrame();
if( !view ) if( !view )