| 28 | bool _video_vsync; ///< Whether we should use vsync (only if active video driver supports HW acceleration). |
| 29 | |
| 30 | void VideoDriver::GameLoop() |
| 31 | { |
| 32 | this->next_game_tick += this->GetGameInterval(); |
| 33 | |
| 34 | /* Avoid next_game_tick getting behind more and more if it cannot keep up. */ |
| 35 | auto now = std::chrono::steady_clock::now(); |
| 36 | if (this->next_game_tick < now - ALLOWED_DRIFT * this->GetGameInterval()) this->next_game_tick = now; |
| 37 | |
| 38 | { |
| 39 | std::lock_guard<std::mutex> lock(this->game_state_mutex); |
| 40 | |
| 41 | ::GameLoop(); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | void VideoDriver::GameThread() |
| 46 | { |
no test coverage detected