mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Reduce viewer frame rate when it doesn't have focus.
This commit is contained in:
parent
672925ac04
commit
43255b01fa
@ -252,6 +252,11 @@ int main( int argc, char** argv )
|
|||||||
ImGui::Render();
|
ImGui::Render();
|
||||||
ImGui_ImplGlfwGL3_RenderDrawData(ImGui::GetDrawData());
|
ImGui_ImplGlfwGL3_RenderDrawData(ImGui::GetDrawData());
|
||||||
glfwSwapBuffers(window);
|
glfwSwapBuffers(window);
|
||||||
|
|
||||||
|
if( !glfwGetWindowAttrib( window, GLFW_FOCUSED ) )
|
||||||
|
{
|
||||||
|
std::this_thread::sleep_for( std::chrono::milliseconds( 50 ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
|
Loading…
Reference in New Issue
Block a user