Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some minor issues with the api samples base class #1196

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions framework/api_vulkan_sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ void ApiVulkanSample::input_event(const vkb::InputEvent &input_event)
{
get_gui().visible = !get_gui().visible;
}
break;
SaschaWillems marked this conversation as resolved.
Show resolved Hide resolved
default:
break;
}
Expand Down Expand Up @@ -703,7 +704,7 @@ void ApiVulkanSample::setup_depth_stencil()

void ApiVulkanSample::setup_framebuffer()
{
VkImageView attachments[2];
VkImageView attachments[2]{};

// Depth/Stencil attachment is the same for all frame buffers
attachments[1] = depth_stencil.view;
Expand Down Expand Up @@ -781,7 +782,7 @@ void ApiVulkanSample::setup_render_pass()
subpass_description.pResolveAttachments = nullptr;

// Subpass dependencies for layout transitions
std::array<VkSubpassDependency, 2> dependencies;
std::array<VkSubpassDependency, 2> dependencies{};

dependencies[0].srcSubpass = VK_SUBPASS_EXTERNAL;
dependencies[0].dstSubpass = 0;
Expand Down Expand Up @@ -866,7 +867,7 @@ void ApiVulkanSample::update_render_pass_flags(uint32_t flags)
subpass_description.pResolveAttachments = nullptr;

// Subpass dependencies for layout transitions
std::array<VkSubpassDependency, 2> dependencies;
std::array<VkSubpassDependency, 2> dependencies{};

dependencies[0].srcSubpass = VK_SUBPASS_EXTERNAL;
dependencies[0].dstSubpass = 0;
Expand Down
5 changes: 2 additions & 3 deletions framework/api_vulkan_sample.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ class ApiVulkanSample : public vkb::VulkanSampleC

virtual void update(float delta_time) override;

virtual void update_overlay(float delta_time, const std::function<void()> &additional_ui) override;

virtual bool resize(const uint32_t width, const uint32_t height) override;

virtual void render(float delta_time) = 0;
Expand Down Expand Up @@ -363,8 +361,9 @@ class ApiVulkanSample : public vkb::VulkanSampleC
/**
* @brief Updates the overlay
* @param delta_time The time taken since the last frame
* @param additional_ui Function that implements an additional Gui
*/
void update_overlay(float delta_time);
void update_overlay(float delta_time, const std::function<void()> &additional_ui) override;

/**
* @brief If the gui is enabled, then record the drawing commands to a command buffer
Expand Down
Loading