| 51 | } |
| 52 | |
| 53 | float PiccoloEngine::calculateDeltaTime() |
| 54 | { |
| 55 | float delta_time; |
| 56 | { |
| 57 | using namespace std::chrono; |
| 58 | |
| 59 | steady_clock::time_point tick_time_point = steady_clock::now(); |
| 60 | duration<float> time_span = duration_cast<duration<float>>(tick_time_point - m_last_tick_time_point); |
| 61 | delta_time = time_span.count(); |
| 62 | |
| 63 | m_last_tick_time_point = tick_time_point; |
| 64 | } |
| 65 | return delta_time; |
| 66 | } |
| 67 | |
| 68 | bool PiccoloEngine::tickOneFrame(float delta_time) |
| 69 | { |