| 308 | } |
| 309 | |
| 310 | void AbyssEngine::run() { |
| 311 | SDL_ShowCursor(SDL_FALSE); |
| 312 | auto lastTime = std::chrono::high_resolution_clock::now(); |
| 313 | while (_running) { |
| 314 | auto currentTime = std::chrono::high_resolution_clock::now(); |
| 315 | auto deltaTime = currentTime - lastTime; |
| 316 | lastTime = currentTime; |
| 317 | processEvents(deltaTime); |
| 318 | render(); |
| 319 | processSceneChange(); |
| 320 | |
| 321 | if (_videoStream != nullptr && !_videoStream->getIsPlaying()) { |
| 322 | _videoStream.reset(nullptr); |
| 323 | } |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | void AbyssEngine::setScene(std::unique_ptr<Common::Scene> scene) { |
| 328 | if (_nextScene != nullptr) { |