From: Eleni Maria Stea Date: Fri, 4 Jun 2021 13:21:13 +0000 (+0300) Subject: forgot to include ui.[hc] in the repo X-Git-Url: https://eleni.mutantstargoat.com/git/?a=commitdiff_plain;ds=inline;h=0e02d2e2c52c4906fcdc1123fe2ec75d46230ead;p=vkrt forgot to include ui.[hc] in the repo --- diff --git a/src/ui.c b/src/ui.c new file mode 100644 index 0000000..13f96fc --- /dev/null +++ b/src/ui.c @@ -0,0 +1,19 @@ +#include +#include "ui.h" + +bool +vk_create_swapchain(struct vk_ctx *ctx, + struct vk_swapchain *swapchain) +{ + VkSwapchainCreateInfoKHR s_info; + + memset(&s_info, 0, sizeof s_info); + s_info.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR; + s_info.flags = VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR; + s_info.surface = swapchain->surface; + s_info.minImageCount = 2; + + // FIXME: to be continued + + return true; +} diff --git a/src/ui.h b/src/ui.h new file mode 100644 index 0000000..6cc6713 --- /dev/null +++ b/src/ui.h @@ -0,0 +1,23 @@ +#ifndef UI_H +#define UI_H + +#include "vk.h" + +struct vk_swapchain +{ + VkSwapchainKHR swapchain; + VkSurfaceKHR surface; + VkSurfaceFormatKHR surf_fmt; + uint32_t num_images; + VkExtent2D extent2d; +}; + +/* swapchain */ +bool +vk_create_swapchain(struct vk_ctx *ctx, + struct vk_swapchain *swapchain); +void +vk_destroy_swapchain(struct vk_ctx *ctx, + struct vk_swapchain *swapchain); + +#endif /* UI_H */