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

Method update_overlay

framework/api_vulkan_sample.cpp:470–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

468}
469
470void ApiVulkanSample::update_overlay(float delta_time, const std::function<void()> &additional_ui)
471{
472 if (has_gui())
473 {
474 frame_count++;
475 accumulated_time += delta_time;
476 if (0.5f < accumulated_time)
477 {
478 fps = static_cast<uint32_t>(frame_count / accumulated_time);
479 frame_count = 0;
480 accumulated_time = 0.0f;
481 }
482
483 get_gui().show_simple_window(get_name(), fps, [this, additional_ui]() {
484 on_update_ui_overlay(get_gui().get_drawer());
485 additional_ui();
486 });
487
488 get_gui().update(delta_time);
489
490 if (get_gui().update_buffers() || get_gui().get_drawer().is_dirty())
491 {
492 rebuild_command_buffers();
493 get_gui().get_drawer().clear();
494 }
495 }
496}
497
498void ApiVulkanSample::draw_ui(const VkCommandBuffer command_buffer)
499{

Callers

nothing calls this directly

Calls 6

show_simple_windowMethod · 0.80
get_drawerMethod · 0.80
update_buffersMethod · 0.80
updateMethod · 0.45
is_dirtyMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected