Support right & middle mouse dragging, set macOS frameTimer based on vsync refresh period

This commit is contained in:
Stephen Saunders 2021-09-15 16:19:34 -04:00
parent 3941a5becd
commit 57e650b653
5 changed files with 49 additions and 8 deletions

View file

@ -242,8 +242,8 @@ void VulkanExampleBase::nextFrame()
frameCounter++;
auto tEnd = std::chrono::high_resolution_clock::now();
auto tDiff = std::chrono::duration<double, std::milli>(tEnd - tStart).count();
#if defined(VK_USE_PLATFORM_MACOS_MVK)
frameTimer = (float)tDiff / 100.0f; // SRS - Divide by 100 for macOS - perhaps shorter tDiff due to background rendering?
#if (defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_MACOS_MVK))
frameTimer = (float)tDiff * refreshPeriod; // SRS - Multiply by the display refresh period due to fixed vsync rendering on iOS and macOS
#else
frameTimer = (float)tDiff / 1000.0f;
#endif