forgot to include ui.[hc] in the repo
authorEleni Maria Stea <elene.mst@gmail.com>
Fri, 4 Jun 2021 13:21:13 +0000 (16:21 +0300)
committerEleni Maria Stea <elene.mst@gmail.com>
Fri, 4 Jun 2021 13:21:13 +0000 (16:21 +0300)
src/ui.c [new file with mode: 0644]
src/ui.h [new file with mode: 0644]

diff --git a/src/ui.c b/src/ui.c
new file mode 100644 (file)
index 0000000..13f96fc
--- /dev/null
+++ b/src/ui.c
@@ -0,0 +1,19 @@
+#include <string.h>
+#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 (file)
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 */