| 259 | } |
| 260 | |
| 261 | void Platform::update() |
| 262 | { |
| 263 | auto delta_time = static_cast<float>(timer.tick<Timer::Seconds>()); |
| 264 | |
| 265 | if (focused || always_render) |
| 266 | { |
| 267 | on_update(delta_time); |
| 268 | |
| 269 | if (fixed_simulation_fps) |
| 270 | { |
| 271 | delta_time = simulation_frame_time; |
| 272 | } |
| 273 | |
| 274 | active_app->update_overlay(delta_time, [=, this]() { |
| 275 | on_update_ui_overlay(*active_app->get_drawer()); |
| 276 | }); |
| 277 | active_app->update(delta_time); |
| 278 | |
| 279 | if (auto *app = dynamic_cast<VulkanSampleCpp *>(active_app.get())) |
| 280 | { |
| 281 | if (app->has_render_context()) |
| 282 | { |
| 283 | on_post_draw(reinterpret_cast<vkb::rendering::RenderContextC &>(app->get_render_context())); |
| 284 | } |
| 285 | } |
| 286 | else if (auto *app = dynamic_cast<VulkanSampleC *>(active_app.get())) |
| 287 | { |
| 288 | if (app->has_render_context()) |
| 289 | { |
| 290 | on_post_draw(app->get_render_context()); |
| 291 | } |
| 292 | } |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | void Platform::terminate(ExitCode code) |
| 297 | { |
no test coverage detected