From 0e02d2e2c52c4906fcdc1123fe2ec75d46230ead Mon Sep 17 00:00:00 2001 From: Eleni Maria Stea Date: Fri, 4 Jun 2021 16:21:13 +0300 Subject: [PATCH] forgot to include ui.[hc] in the repo --- src/ui.c | 19 +++++++++++++++++++ src/ui.h | 23 +++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/ui.c create mode 100644 src/ui.h 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 */ -- 1.7.10.4