Limit time delta to 0.1s.

This commit is contained in:
Bartosz Taudul 2022-12-11 18:01:32 +01:00
parent 9e6214350c
commit b80ede3ec6
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -521,7 +521,7 @@ void Backend::NewFrame( int& w, int& h )
ImGui_ImplOpenGL3_NewFrame();
uint64_t time = std::chrono::duration_cast<std::chrono::microseconds>( std::chrono::high_resolution_clock::now().time_since_epoch() ).count();
io.DeltaTime = ( time - s_time ) / 1000000.f;
io.DeltaTime = std::min( 0.1f, ( time - s_time ) / 1000000.f );
s_time = time;
}