Android timer (#97)

This commit is contained in:
saschawillems 2016-03-24 22:43:33 +01:00
parent b6cd07c3c5
commit 5adb44e2ac

View file

@ -387,6 +387,15 @@ void VulkanExampleBase::renderLoop()
auto tEnd = std::chrono::high_resolution_clock::now(); auto tEnd = std::chrono::high_resolution_clock::now();
auto tDiff = std::chrono::duration<double, std::milli>(tEnd - tStart).count(); auto tDiff = std::chrono::duration<double, std::milli>(tEnd - tStart).count();
frameTimer = tDiff / 1000.0f; frameTimer = tDiff / 1000.0f;
// Convert to clamped timer value
if (!paused)
{
timer += timerSpeed * frameTimer;
if (timer > 1.0)
{
timer -= 1.0f;
}
}
// Check gamepad state // Check gamepad state
const float deadZone = 0.10f; const float deadZone = 0.10f;
// todo : check if gamepad is present // todo : check if gamepad is present