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

Method update

samples/performance/afbc/afbc.cpp:79–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77{
78 vkb::VulkanSampleC::request_device_extensions(requested_extensions);
79
80 // Extension that may be used to query if AFBC is enabled
81 requested_extensions[VK_EXT_IMAGE_COMPRESSION_CONTROL_EXTENSION_NAME] = vkb::RequestMode::Optional;
82}
83
84void AFBCSample::update(float delta_time)
85{
86 if (afbc_enabled != afbc_enabled_last_value)
87 {
88 recreate_swapchain();
89
90 afbc_enabled_last_value = afbc_enabled;
91 }
92
93 /* Pan the camera back and forth. */
94 auto &camera_transform = camera->get_node()->get_component<vkb::sg::Transform>();
95
96 elapsed_time += delta_time;
97 float rotation_factor = elapsed_time;
98
99 glm::quat qy = glm::angleAxis(0.003f * sin(rotation_factor * 0.7f), glm::vec3(0.0f, 1.0f, 0.0f));
100 glm::quat orientation = glm::normalize(qy * camera_transform.get_rotation() * glm::angleAxis(0.0f, glm::vec3(1.0f, 0.0f, 0.0f)));
101 camera_transform.set_rotation(orientation);
102

Calls 2

get_nodeMethod · 0.45
set_rotationMethod · 0.45

Tested by

no test coverage detected