Added some extra swapchain params to app

This commit is contained in:
Warwick New 2024-12-30 16:23:08 +00:00
parent 08c8b689ad
commit 7c7c01bdac

View file

@ -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);