mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
OpenGL: Avoid signed integer truncation when computing frame time differences
This commit is contained in:
parent
604e090372
commit
722b552657
1 changed files with 2 additions and 1 deletions
|
|
@ -180,7 +180,8 @@ public:
|
|||
// and sleeps if necessary.
|
||||
|
||||
auto swapTime = Time::getMillisecondCounterHiRes() - now;
|
||||
auto frameTime = (int) (now - lastSwapTime);
|
||||
auto frameTime = (int) std::min ((uint64_t) std::numeric_limits<int>::max(),
|
||||
(uint64_t) now - (uint64_t) lastSwapTime);
|
||||
|
||||
if (swapTime < 0.5 && frameTime < minSwapTime - 3)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue