MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / update

Method update

framework/platform/platform.cpp:261–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261void 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
296void Platform::terminate(ExitCode code)
297{

Callers 1

main_loop_frameMethod · 0.45

Calls 4

get_drawerMethod · 0.80
has_render_contextMethod · 0.80
update_overlayMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected