Handle keyboard and mouse events, adjust frameTimer scaling for macOS

This commit is contained in:
Stephen Saunders 2021-09-12 02:34:38 -04:00
parent 28d98b9ee7
commit a74afb20fc
5 changed files with 181 additions and 18 deletions

View file

@ -242,7 +242,11 @@ 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?
#else
frameTimer = (float)tDiff / 1000.0f;
#endif
camera.update(frameTimer);
if (camera.moving())
{