From 7c7c01bdac6e25ff170f1021910f81bdf50772a8 Mon Sep 17 00:00:00 2001 From: Warwick New Date: Mon, 30 Dec 2024 16:23:08 +0000 Subject: [PATCH] Added some extra swapchain params to app --- src/main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 4430366..fc9c921 100644 --- a/src/main.c +++ b/src/main.c @@ -48,6 +48,9 @@ typedef struct Application { VkQueue graphicsQueue; VkQueue presentQueue; VkSwapchainKHR swapChain; + VkImage *swapChainImages; + VkFormat swapChainImageFormat; + VkExtent2D swapChainExtent; } Application; typedef struct SwapChainSupportDetails { @@ -562,6 +565,9 @@ void createSwapChain(Application *app) { fprintf(stderr, "Failed to create swapchain!"); exit(EXIT_FAILURE); } + + app->swapChainImageFormat = surfaceFormat.format; + app->swapChainExtent = extent; } void initVulkan(Application *app) { @@ -592,7 +598,7 @@ void cleanup(Application *app) { } int main(void) { - Application app; + Application app = {0}; initWindow(&app); initVulkan(&app);