Android timer (#97)
This commit is contained in:
parent
b6cd07c3c5
commit
5adb44e2ac
1 changed files with 9 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue