Frame timing for android (#97)

This commit is contained in:
saschawillems 2016-03-23 22:16:05 +01:00
parent edf195efb6
commit a8734f7f46

View file

@ -381,7 +381,12 @@ void VulkanExampleBase::renderLoop()
// Render frame // Render frame
if (prepared) if (prepared)
{ {
auto tStart = std::chrono::high_resolution_clock::now();
render(); render();
frameCounter++;
auto tEnd = std::chrono::high_resolution_clock::now();
auto tDiff = std::chrono::duration<double, std::milli>(tEnd - tStart).count();
frameTimer = tDiff / 1000.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